Category Archives: Linux

xfs filesystem duplicate UUID

If you clone a volume with xfs filesystem on it and you try to mount this on the same node, than normally you will receive error messages, like wrong fs type, bas superblock,… you have the problem with xfs filesystem duplicate UUID.

In the dmesg you should file a message like:

XFS: Filesystem sdb1 has duplicate UUID - can't mount.

If its a one time mount you can do it with:

sudo mount -o nouuid /dev/sdb1 /mnt

But the better solution is to generate a new uuid for the filesystem, because its clean and you can mount it easy without problems:

sudo xfs_admin -U generate /dev/sdb1
Clearing log and setting UUID
writing all SBs
new UUID = 01fbb4f2-1ers0-4dde-94fc-024efb3cd2a4
after that, you can mount this XFS partition regularly.

Then mount the volume normally with mount:

sudo mount /dev/sdb1 /mnt

git commit forget Signed-off-by

If you forget to set “Signed-off-by” in the commit. This is now problem, you can still do it afterwards.

To sign-off the last two commits:

git filter-branch --msg-filter "cat - && echo && echo 'Signed-off-by: Your Name '" HEAD~2..HEAD

Then force to push them to the remote repo with the -f option:

git push -f

Vagrant 1.8.5 – public key problem

If you like to create with kitchen a new Vagrant instance with the Vagrant version 1.8.5 you get the following problem:

           default: Vagrant insecure key detected. Vagrant will automatically replace
           default: this with a newly generated keypair for better security.
           default:
           default: Inserting generated public key within guest...
           default: Removing insecure key from the guest if it's present...
           default: Key inserted! Disconnecting and reconnecting using new SSH key...
           default: Warning: Authentication failure. Retrying...
           default: Warning: Authentication failure. Retrying...
           default: Warning: Authentication failure. Retrying...
           default: Warning: Authentication failure. Retrying...
           default: Warning: Authentication failure. Retrying...
           default: Warning: Authentication failure. Retrying...
           default: Warning: Authentication failure. Retrying...
           default: Warning: Authentication failure. Retrying...

To fix this, you should create this file:

vi .vagrant.d/Vagrantfile

With the content:

Vagrant.configure("2") do |config|
  config.ssh.insert_key = false
end

Move logical Volumes to other volume group and remove the physical volume.

At the beginning, it look like:

~# lvs
  LV         VG         Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  log        system     -wi-ao----  1.86g
  root       system     -wi-ao----  2.79g
  swap       system     -wi-ao----  1.86g
  tmp        system     -wi-ao----  1.86g
  usr        system     -wi-ao----  1.86g
  var        system     -wi-ao---- 31.72g
  testlv     systemtest -wi-------  5.00g
  testlv2    systemtest -wi------- 20.00g
~# pvs
  PV         VG         Fmt  Attr PSize   PFree
  /dev/md0   systemtest lvm2 a--  884.63g 859.63g
  /dev/sdk3  system     lvm2 a--  147.61g 105.66g

Now we begin to merge the two volume groups to one.

vgsplit -n systemtest/testlv systemtest system

Now it look like:

~# pvs
  PV         VG     Fmt  Attr PSize   PFree
  /dev/md0   system lvm2 a--  884.63g 859.63g
  /dev/sdk3  system lvm2 a--  147.61g 105.66g
~# lvs
  LV         VG         Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  log        system     -wi-ao----  1.86g
  root       system     -wi-ao----  2.79g
  swap       system     -wi-ao----  1.86g
  tmp        system     -wi-ao----  1.86g
  usr        system     -wi-ao----  1.86g
  var        system     -wi-ao---- 31.72g
  testlv     system     -wi-------  5.00g
  testlv2    system     -wi------- 20.00g

Now we want to remove md0, but before we must move the data to the other physical volume.

~# pvmove /dev/md0
  /dev/md0: Moved: 0.0%
  /dev/md0: Moved: 5.5%
  /dev/md0: Moved: 10.6%
  /dev/md0: Moved: 14.1%
  /dev/md0: Moved: 17.6%
  /dev/md0: Moved: 21.8%
  /dev/md0: Moved: 25.3%
  /dev/md0: Moved: 28.9%
  /dev/md0: Moved: 32.4%
  /dev/md0: Moved: 36.2%
  /dev/md0: Moved: 39.8%
  /dev/md0: Moved: 43.6%
  /dev/md0: Moved: 47.4%
  /dev/md0: Moved: 50.7%
  /dev/md0: Moved: 54.6%
  /dev/md0: Moved: 58.1%
  /dev/md0: Moved: 62.0%
  /dev/md0: Moved: 65.9%
  /dev/md0: Moved: 69.1%
  /dev/md0: Moved: 72.9%
  /dev/md0: Moved: 76.9%
  /dev/md0: Moved: 80.0%
  /dev/md0: Moved: 83.7%
  /dev/md0: Moved: 87.2%
  /dev/md0: Moved: 90.8%
  /dev/md0: Moved: 95.0%
  /dev/md0: Moved: 98.6%
  /dev/md0: Moved: 100.0%

Now we can remove the md0 from the system volume group.

~# vgreduce system /dev/md0
  Removed "/dev/md0" from volume group "system"

OpenBSD chef client

OpenBSD chef client

If you like to install chef client on OpenBSD, you must install ruby on it:

pkg_add ruby
quirks-2.114 signed on 2015-08-09T11:57:52Z
Ambiguous: choose package for ruby
a       0: 
        1: ruby-1.8.7.374p4
        2: ruby-1.9.3.551p2
        3: ruby-2.0.0.645p0
        4: ruby-2.1.6p0
        5: ruby-2.2.2p0
Your choice: 5
ruby-2.2.2p0:libffi-3.1p0: ok
ruby-2.2.2p0:libyaml-0.1.6p1: ok
ruby-2.2.2p0:gmp-5.0.2p3: ok
ruby-2.2.2p0: ok
--- +ruby-2.2.2p0 -------------------
If you want to use this package as your default system ruby, as root
create symbolic links like so (overwriting any previous default):
 ln -sf /usr/local/bin/ruby22 /usr/local/bin/ruby
 ln -sf /usr/local/bin/erb22 /usr/local/bin/erb
 ln -sf /usr/local/bin/irb22 /usr/local/bin/irb
 ln -sf /usr/local/bin/rdoc22 /usr/local/bin/rdoc
 ln -sf /usr/local/bin/ri22 /usr/local/bin/ri
 ln -sf /usr/local/bin/rake22 /usr/local/bin/rake
 ln -sf /usr/local/bin/gem22 /usr/local/bin/gem

Now install chef client:

gem install chef