Category Archives: System

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

sudo with Touch ID on macOS

Apple Touch ID with sudo in macOS

If you like to integrate Touch ID in sudo, you can do this easily in macOS and use the fingerprint.

Integration in sudo

Just edit the /private/etc/pam.d/sudo file and put a line inside.

sudo -e /private/etc/pam.d/sudo

Put the following information inside:

auth       sufficient     pam_tid.so

The file should look like:

# sudo: auth account password session
auth       sufficient     pam_tid.so
auth       sufficient     pam_smartcard.so
auth       required       pam_opendirectory.so
account    required       pam_permit.so
password   required       pam_deny.so
session    required       pam_permit.so

Testing

To test the integration, just echo with sudo.

sudo echo "test"
sudo with Touch ID
sudo with Touch ID

Macbook delete fingerprint information

Apple fingerprint information clear

If you want to return, repair or sell your Apple device. Then you should make sure that all data is deleted. This way the fingerprint information should also be deleted.

Clear Touch Bar information

To delete the fingerprint information, the Apple device must be set to Recorvery mode and open the Terminal.

  1. Restart
  2. Hold down Command-R
  3. Utilities -> Terminal
xartutil –erase-all

You get the question if you are sure, you have to confirm this with “yes” and press Return.

Checking

After rebooting, you can easily check the settings to see if it worked.

no fingerprint

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

macOS Sierra – [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0

If you have problems, when you update to macOS Sierra and receive this message:

[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0

Reinstall with brew libevent package:

brew reinstall libevent
==> Reinstalling libevent
==> Downloading https://homebrew.bintray.com/bottles/libevent-2.0.22.sierra.bottle.1.tar.gz
######################################################################## 100,0%
==> Pouring libevent-2.0.22.sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/libevent/2.0.22: 734 files, 2.0M

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"