That was how I got the LABEL and UUID:
[root ~]# /usr/sbin/xfs_admin -lu /dev/sdb label = "/mysql2" UUID = 2560a02a-239b-4ac5-affe-cf71f8e87150
cn=John Shen,title=Sys. Admin.,ou=Operations,dc=StumbleUpon,dc=com
----- Original Message ----- Date: Mon, 06 Oct 2008 11:03:37 +0100 From: James Pearson james-p@moving-picture.com Subject: Re: [CentOS-devel] Re: xfs volume can not be mounted with uuid or label, only scsi device name /dev/sdb
John Shen wrote:
sorry for the confusion, i did use the uppercase in fstab.
# neither of the following works # UUID=2560a02a-239b-4ac5-affe-cf71f8e87150 /var/lib/mysql xfs noatime 0 0 #LABEL=/mysql2 /var/lib/mysql xfs noatime 0 0 # only this works /dev/sdb /var/lib/mysql xfs noatime 0 0
What does xfs_admin report about the label and uuid? :
/usr/sbin/xfs_admin -lu /dev/sdb
James Pearson
John Shen wrote:
That was how I got the LABEL and UUID:
[root ~]# /usr/sbin/xfs_admin -lu /dev/sdb label = "/mysql2" UUID = 2560a02a-239b-4ac5-affe-cf71f8e87150
Strange ... works fine for me ...
What are the exact messages when it fails? - anything in /var/log/messages?
Have you tried strace'ing the mount command to see what it is doing?
James Pearson
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
John Shen wrote:
That was how I got the LABEL and UUID:
[root ~]# /usr/sbin/xfs_admin -lu /dev/sdb label = "/mysql2" UUID = 2560a02a-239b-4ac5-affe-cf71f8e87150
/dev/sdb is the whole bleeding disk. Did you add partitions to it? Then one would expect something like /dev/sdb1 instead.
Hugo. (cn=Hugo van der Kooij, title=Uncle, ou=family, dc=vanderkooij, dc=org ;-)
- -- hvdkooij@vanderkooij.org http://hugo.vanderkooij.org/ PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc
A: Yes. >Q: Are you sure? >>A: Because it reverses the logical flow of conversation. >>>Q: Why is top posting frowned upon?
Bored? Click on http://spamornot.org/ and rate those images.
Hugo van der Kooij wrote:
John Shen wrote:
That was how I got the LABEL and UUID:
[root ~]# /usr/sbin/xfs_admin -lu /dev/sdb label = "/mysql2" UUID = 2560a02a-239b-4ac5-affe-cf71f8e87150
/dev/sdb is the whole bleeding disk. Did you add partitions to it? Then one would expect something like /dev/sdb1 instead.
Good catch, Hugo!
The mount(8) man page says: -L label Mount the partition that has the specified label. -U uuid Mount the partition that has the specified uuid. These two options require the file /proc/partitions (present since Linux 2.1.116) to exist.
This would indicate that filesystem label detection only works on partitions, not raw devices. John - try actually creating a partition table on this disk, and then put your filesystem on /dev/sdb1. I am guessing that you will find that detection magically starts working after you do that.
Brandon Davidson wrote:
Hugo van der Kooij wrote:
John Shen wrote:
That was how I got the LABEL and UUID:
[root ~]# /usr/sbin/xfs_admin -lu /dev/sdb label = "/mysql2" UUID = 2560a02a-239b-4ac5-affe-cf71f8e87150
/dev/sdb is the whole bleeding disk. Did you add partitions to it? Then one would expect something like /dev/sdb1 instead.
Good catch, Hugo!
The mount(8) man page says: -L label Mount the partition that has the specified label. -U uuid Mount the partition that has the specified uuid. These two options require the file /proc/partitions (present since Linux 2.1.116) to exist.
This would indicate that filesystem label detection only works on partitions, not raw devices. John - try actually creating a partition table on this disk, and then put your filesystem on /dev/sdb1. I am guessing that you will find that detection magically starts working after you do that.
Works fine for me:
# xfs_admin -lu /dev/sdb label = "/test" UUID = 9aa81fbd-3f6d-4d3d-a40f-2a5483f8fe5c # mount LABEL=/test /mnt/tmp # df /mnt/tmp Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdb 11584 64 11520 1% /mnt/tmp # mount | grep /mnt/tmp /dev/sdb on /mnt/tmp type xfs (rw) # umount /mnt/tmp # mount UUID=9aa81fbd-3f6d-4d3d-a40f-2a5483f8fe5c /mnt/tmp # df /mnt/tmp Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdb 11584 64 11520 1% /mnt/tmp # mount | grep /mnt/tmp /dev/sdb on /mnt/tmp type xfs (rw)
i.e. the above is an XFS file system on the whole of /dev/sdb - which I can mount fine via its LABEL or UUID ...
However, it appears that this only works if there is an entry for this file system in /etc/blkid/blkid.tab (that mount creates/updates)
If I umount the file system, and then remove the line for /dev/sdb in /etc/blkid/blkid.tab - I then can't mount by LABEL or UUID - unless I previously mount by device ...
This appears to be the case for ext3 as well as xfs ...
Using a partition, then all works as expected.
James Pearson