You are not logged in.

#1 2017-08-12 19:50:10

Stephentt
Member
Registered: 2017-08-09
Posts: 11

ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

This is my partition structure:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     4G  0 part [SWAP]
├─sda3   8:3    0    30G  0 part /
├─sda4   8:4    0    30G  0 part /home
└─sda5   8:5    0  47.3G  0 part 
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0   500G  0 part /media/storage
├─sdb2   8:18   0   250G  0 part
└─sdb3   8:19   0 181.5G  0 part 

At first, my /dev/sdb1 is zfs, and it have an UUID that can show by query "ls -l /dev/disk/by-uuid/" or "lsblk -f"
But after I format it into xfs (mkfs.xfs), run these command again, I can't find /dev/sdb1 partition UUID:

~ 
➜ sudo mkfs.xfs -f /dev/sdb1   

~ 
➜ lsblk -f 
NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
sda                                                      
├─sda1 vfat         65A8-22C5                            /boot/efi
├─sda2 swap         a7606bc5-f513-4065-b2c7-d1cf3d6eea9b [SWAP]
├─sda3 ext4         b96a864b-45da-4700-899d-b7738dd136aa /
├─sda4 ext4         8a181b5c-ee2c-4eb0-a818-4b05e7006cff /home
└─sda5 ntfs         0541950B1642060A                     
sdb                                                      
├─sdb1                                                   /media/storage
├─sdb2 ext4         e71bf3b3-3f93-4449-b0be-bc9dcb455071 
└─sdb3 ntfs         362E37E5233382DE                     

~ 
➜ ls -l /dev/disk/by-uuid/ 
total 0
lrwxrwxrwx 1 root root 10 Aug 13 01:45 0541950B1642060A -> ../../sda5
lrwxrwxrwx 1 root root 10 Aug 13 01:45 362E37E5233382DE -> ../../sdb3
lrwxrwxrwx 1 root root 10 Aug 13 01:45 65A8-22C5 -> ../../sda1
lrwxrwxrwx 1 root root 10 Aug 13 01:45 8a181b5c-ee2c-4eb0-a818-4b05e7006cff -> ../../sda4
lrwxrwxrwx 1 root root 10 Aug 13 01:45 a7606bc5-f513-4065-b2c7-d1cf3d6eea9b -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 13 01:45 b96a864b-45da-4700-899d-b7738dd136aa -> ../../sda3
lrwxrwxrwx 1 root root 10 Aug 13 01:45 e71bf3b3-3f93-4449-b0be-bc9dcb455071 -> ../../sdb2

I can't figure out why it happen? Thank you for your help.

Offline

#2 2017-08-12 20:16:56

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

Output of blkid may help a bit


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#3 2017-08-12 20:20:00

Stephentt
Member
Registered: 2017-08-09
Posts: 11

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

This is my `blkid`

➜ sudo blkid  
/dev/sdb2: UUID="e71bf3b3-3f93-4449-b0be-bc9dcb455071" TYPE="ext4" PARTLABEL="External4" PARTUUID="b5ff19b7-d23c-41eb-872e-ca55ac0c79a0"
/dev/sdb3: UUID="362E37E5233382DE" TYPE="ntfs" PTTYPE="dos" PARTLABEL="NewFileSystem" PARTUUID="ad4a223b-8964-4377-b1bf-fc5542bbe48a"
/dev/sda1: UUID="65A8-22C5" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="aadf51c3-fd39-49a5-9112-2f8417bfe2e3"
/dev/sda2: UUID="a7606bc5-f513-4065-b2c7-d1cf3d6eea9b" TYPE="swap" PARTLABEL="Swap" PARTUUID="8200699c-9c79-417c-8e7c-c9b0c8877e10"
/dev/sda3: UUID="b96a864b-45da-4700-899d-b7738dd136aa" TYPE="ext4" PARTLABEL="Archlinux" PARTUUID="26d26d4a-7408-4495-ad11-ae402b7ea49a"
/dev/sda4: UUID="8a181b5c-ee2c-4eb0-a818-4b05e7006cff" TYPE="ext4" PARTLABEL="Home" PARTUUID="7093cee9-5aa1-439e-ae3a-9d9b97e284d1"
/dev/sda5: UUID="0541950B1642060A" TYPE="ntfs" PARTLABEL="" PARTUUID="00a75dd1-b83f-4f9f-a926-6fb90f07facb"

Offline

#4 2017-08-12 21:18:30

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

Check if

xfs_admin -u /dev/sdb1

generates anything


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#5 2017-08-12 21:32:31

Stephentt
Member
Registered: 2017-08-09
Posts: 11

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

dockland wrote:

Check if

xfs_admin -u /dev/sdb1

generates anything

Thank you.

As I know, the "xfs_admin -u" will

     -u     Print the current filesystem UUID (Universally Unique IDentifier).

And yes, It prints an UUID.

➜ sudo xfs_admin -u /dev/sdb1
UUID = 8c3202b1-c7b1-408e-9388-6ce9635ec886

But, it not update in any common cheking command.

➜ lsblk -f      
NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
sda                                                      
├─sda1 vfat         65A8-22C5                            /boot/efi
├─sda2 swap         a7606bc5-f513-4065-b2c7-d1cf3d6eea9b [SWAP]
├─sda3 ext4         b96a864b-45da-4700-899d-b7738dd136aa /
├─sda4 ext4         8a181b5c-ee2c-4eb0-a818-4b05e7006cff /home
└─sda5 ntfs         0541950B1642060A                     
sdb                                                      
├─sdb1                                                   /media/storage
├─sdb2 ext4         e71bf3b3-3f93-4449-b0be-bc9dcb455071 
└─sdb3 ntfs         362E37E5233382DE                     

~ 
➜ ls -l /dev/disk/by-uuid/ 
total 0
lrwxrwxrwx 1 root root 10 Aug 13 03:42 0541950B1642060A -> ../../sda5
lrwxrwxrwx 1 root root 10 Aug 13 03:42 362E37E5233382DE -> ../../sdb3
lrwxrwxrwx 1 root root 10 Aug 13 03:42 65A8-22C5 -> ../../sda1
lrwxrwxrwx 1 root root 10 Aug 13 03:42 8a181b5c-ee2c-4eb0-a818-4b05e7006cff -> ../../sda4
lrwxrwxrwx 1 root root 10 Aug 13 03:42 a7606bc5-f513-4065-b2c7-d1cf3d6eea9b -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 13 03:42 b96a864b-45da-4700-899d-b7738dd136aa -> ../../sda3
lrwxrwxrwx 1 root root 10 Aug 13 03:42 e71bf3b3-3f93-4449-b0be-bc9dcb455071 -> ../../sdb2

Which is a strange behavior. I don't know is it good to use it?

Offline

#6 2017-08-12 21:40:52

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

Please post your fstab


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#7 2017-08-12 21:46:59

Stephentt
Member
Registered: 2017-08-09
Posts: 11

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

My fstab:

➜ cat /etc/fstab 
UUID=b96a864b-45da-4700-899d-b7738dd136aa	/         	ext4      	rw,relatime,data=ordered	0 1

UUID=8a181b5c-ee2c-4eb0-a818-4b05e7006cff	/home     	ext4      	rw,relatime,data=ordered	0 2

UUID=65A8-22C5      	/boot/efi 	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro	0 2

/dev/sdb1   /media/storage  xfs     defaults    0 2

Yup, I wanna use UUID for all partition, but because I can't get UUID of /dev/sdb1 so I mounted /dev/sdb1 like that.

Offline

#8 2017-08-12 21:50:09

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

Put the UUID (8c3202b1-c7b1-408e-9388-6ce9635ec886) for the /media/storage in your fstab aswell. Reboot


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#9 2017-08-13 05:15:09

Stephentt
Member
Registered: 2017-08-09
Posts: 11

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

dockland wrote:

Put the UUID (8c3202b1-c7b1-408e-9388-6ce9635ec886) for the /media/storage in your fstab aswell. Reboot

I just try it, and I can't boot into os. Image below.
http://i.imgur.com/38N6X16.jpg

The new fstab have this row:

UUID=8c3202b1-c7b1-408e-9388-6ce9635ec886   /media/storage  xfs     defaults    0 2

The old one

/dev/sdb1	media/storage  xfs     defaults    0 2

moderator edit [ewaller] converted over sized image to url link

Last edited by ewaller (2017-08-13 17:16:46)

Offline

#10 2017-08-13 15:32:54

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

This might be a corrupt partition table. I read along another (Fedora) forum. Check it out if it might help you out.
https://forums.fedoraforum.org/showthread.php?t=288890


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#11 2017-08-14 04:42:08

Stephentt
Member
Registered: 2017-08-09
Posts: 11

Re: ls -l /dev/disk/by-uuid/ not show my new mkfs.xfs UUID

dockland wrote:

This might be a corrupt partition table. I read along another (Fedora) forum. Check it out if it might help you out.
https://forums.fedoraforum.org/showthread.php?t=288890


Thanks for your link. It seems very relevant.

To summarise: if you reformat a partition with another filesystem, recent kernel and libblkid will not try to populate /dev/disk/* if it detects two or more filesystem signatures. If you want to repurpose a partition use wipefs first to eliminate existing signatures.

But I still don't know what to do next. But it's okay I will continue looking for the solution.
Thank you for your time.

Offline

Board footer

Powered by FluxBB