Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for duplicate

January 12, 2021

Mounting Duplicate UUIDs

While trying to recover a directory from backup, I ran into an issue with duplicate uuids when trying to mount a recovered volume. The problem was the recovered volume had the same uuid as boot.

Here’s the original mount command I ran, but I was getting a wrong fs type error.

mkdir
mount -t xfs /dev/nvme3n1p2 /recover
mount: wrong fs type, bad option, bad superblock on /dev/nvme3n1p2,
       missing codepage or helper program, or other error

mkdir mount -t xfs /dev/nvme3n1p2 /recover mount: wrong fs type, bad option, bad superblock on /dev/nvme3n1p2, missing codepage or helper program, or other error

It turned out to be a duplicated uuid. To get around this problem, I ran -o nouuid.

mount -t xfs -o nouuid /dev/nvme3n1p2 /recover

mount -t xfs -o nouuid /dev/nvme3n1p2 /recover

Once the files were recovered, I unmounted volume and detached it from the instance.

October 7, 2019

XFS Filesystem has duplicate UUID

Here’s how to fix a duplicate UUID on a XFS file system.

mount -o rw,nouuid /dev/sda1  /data

mount -o rw,nouuid /dev/sda1 /data

Mounting with nouuid will work, but not after a reboot.

To avoid a duplicate ID, run this command to generate a new UUID.

xfs_admin -U generate /dev/sda3
Clearing log and setting UUID
writing all SBs
new UUID = xxxxx-xxxx-xxxx-xxxxxxxxx

xfs_admin -U generate /dev/sda3 Clearing log and setting UUID writing all SBs new UUID = xxxxx-xxxx-xxxx-xxxxxxxxx

September 14, 2018

Remove Duplicate In A File

Here’s a Perl script for removing duplicates in a file.

perl -ne 'print unless $dup{$_}++;' input_file > output_file

perl -ne 'print unless $dup{$_}++;' input_file > output_file

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021