[CentOS-devel] Re: xfs volume can not be mounted with uuid or label, only scsi device name /dev/sdb (solved)

John Shen jshen at stumbleupon.com
Wed Oct 8 13:00:35 UTC 2008


james, thank you so much for your help. indeed, the problem is that /etc/blkid/blkid.tab still has the old ext3 entry.

i changed TYPE to xfs and updated the uuid for /dev/sdb, and now it mounts fine with UUID. since i prefer UUID anyway, i did not test label, but assume it was the same issue.

yes, we do use the entire device, which never had problems with other fs types, which mount seem to update blkid.tab automatically. still not sure why it did not do so for xfs, but as long as it works, i am happy.

cn=John Shen,title=Sys. Admin.,ou=Operations,dc=StumbleUpon,dc=com

----- Original Message -----
Date: Wed, 08 Oct 2008 11:39:25 +0100
From: James Pearson <james-p at moving-picture.com>
Subject: Re: [CentOS-devel]  Re: xfs volume can not be mounted with
	uuid or	label, only scsi device name /dev/sdb
To: "The CentOS developers mailing list." <centos-devel at centos.org>
Message-ID: <48EC8DDD.3010102 at moving-picture.com>
Content-Type: text/plain; charset=us-ascii; format=flowed

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


------------------------------

_______________________________________________
CentOS-devel mailing list
CentOS-devel at centos.org
http://lists.centos.org/mailman/listinfo/centos-devel


End of CentOS-devel Digest, Vol 44, Issue 7
*******************************************



More information about the CentOS-devel mailing list