Linux – different uuid from blkid and tune2fs

ext4linux

I copied (dd) a partition from /dev/sdb3 (GPT partition) to /dev/vg0/lv0_sys (lvm2 lv)

Sure to be required to adjust the uuid on one of them, I found that blkid shows me two different uuid's for the two. Surprised I looked for other ways to display uuid and came to tune2fs. tune2fs gave me the same uuid for both. This means, that tune2fs and bklid give me different uuid for the copy at /dev/mapper/vg0-lv0_sys

Note, that I used the symlink /dev/vg0/lv0_sys to make the copy, but used the direct path /dev/mapper… to get the uuid. The symlink did not work with blkid. But it did work with tune2fs.

So, what is blkid doing? Does the partition/lv have its own uuid, that is different from the filesystems uuid, but can be the same? And is blkid showing this?

Complete output of blkid:

/dev/sda2: UUID="634cfda6-5ebd-4c12-9480-e9effb2c9c69" TYPE="ext2" 
/dev/sda3: UUID="69fa6b8a-4c53-409b-aec7-d72b1ca9463a" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sda4: UUID="966c08c5-1588-4456-9d82-3c42d6a8e09c" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sda5: UUID="414cef10-c56c-4b23-8508-698ed49360f9" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sda6: UUID="MI8wFf-3wqr-fYR0-iVOk-1gAJ-mDuG-yaUpoK" TYPE="LVM2_member" 
/dev/sda7: UUID="RoZLP3-Owd8-5Fkm-Q33j-X6nS-Eju5-Bqw3Xr" TYPE="LVM2_member" 
/dev/sda8: UUID="fFStIK-Cvqy-kGYt-JDlx-JAAT-VcHb-apY50V" TYPE="LVM2_member" 
/dev/sda9: UUID="EImDQ9-UGI7-sUsM-ihar-vDuB-SSlb-wz7bhy" TYPE="LVM2_member" 
/dev/sdb2: UUID="83556c87-b5f5-44e9-be53-2ae46cab8931" TYPE="ext2" 
/dev/sdb3: UUID="25e6c972-e769-4216-bc18-8d2d1eefa6a1" TYPE="ext4" 
/dev/sdb4: UUID="D2wdPj-RiS1-7ea0-KUUE-NLuq-UZUa-Fe3FuY" TYPE="LVM2_member" 
/dev/mapper/vg0-lv0_sys: UUID="bc2de0a1-4de2-4e61-a19e-376409528fd9" TYPE="ext4" 
/dev/mapper/vg3-lv0_sys: UUID="e9131371-71af-4dcc-a0f6-83673da1330c" SEC_TYPE="ext2" TYPE="ext3" 
/dev/mapper/vg3-lv1_sys: UUID="ddf0a6d9-7bec-41ee-b141-376cb5540d45" TYPE="ext4" 
/dev/mapper/vg3-lv3_swap: UUID="98ef4d82-2994-46ea-9897-36fab66b133a" TYPE="swap" 
/dev/mapper/vg3-lv4_data: UUID="53a306ad-f10b-44cf-90d6-bdb8b4abae3b" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdg1: LABEL="M-@;9M-^X" UUID="CE2C-4586" TYPE="vfat" 

Extra question: What would grub2 use to determine the boot filesystem?

Output of blockdev –getsize64 /dev/sdb3 /dev/vg0/lv0_sys

29997662208
28991029248

Maybe I should add this:
The target partition is smaller, but I resized the filesystem to be smaller (about 26GB) before copying it. I assume, when dd aborts copying due to end of target space, the filesystem should be completely written. An e2fsck /dev/vg0/lv0_sys gave me no errors

Best Answer

If you do not run blkid as root, it cannot actually read any information on the devices and thus must rely on the cache.

Always run blkid as root if anything about the disks has changed.

Related Topic