Re: use UUID mount btrfs failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/10/12 Thomas Mueller <thomas@xxxxxxxxxxxxxx>:
> On 12.10.2011 10:22, huang jun wrote:
>>
>> 2011/10/12 Damien Churchill<damoxc@xxxxxxxxx>:
>>>
>>> On 12 October 2011 02:22, huang jun<hjwsm1989@xxxxxxxxx>  wrote:
>>>>
>>>> I use the UUID option to mount the btrfs disk,but i can not success.
>>>> first, the disk is /dev/sdd1
>>>> then, i pull out the disk
>>>> and after mintues, pushed it again,at this time, it changes to /dev/sde1
>>>> at this time, if we use /etc/init.d/ceph restart, it will failed, for
>>>> the current mount option is likely "/dev/sd** "
>>>> but the UUID didn't change.
>>>> why i can not mount it successfuly?
>>>> BTW, does ceph provides methods to resolve the condition like that?
>>>>
>>>> the starce file attached.
>>>>
>>>> thanks!
>>>>
>>>
>>> Hi,
>>>
>>> I switched to use the symlinks created by udev in /dev/disk/by-id/
>>> which contains the hard-disks serial number which will be completely
>>> static, even if a new btrfs filesystem is created. This ensures that
>>> the same partition on the same disk is always used.
>>>
>>> Regards,
>>> Damien
>>>
>> can you mount successfully by using the /dev/disk/by-id/  instead of
>>  /dev/sd**?
>> and how to get the hard-disk serial number? I have tried "udevadm info
>> -a -p $(udevadm info -q path -n $btrfs_devs)", but failed to get it.
>> or you should  test the condition like that, pull out the disk first
>> and then push it in after few minutes.
>>
>> thanks!
>
> for example with smartctl from the smartmontools you can get the s/n.
>
> smartctl -i /dev/sd*
>
> - Thomas
yah,but how can udev know it, and which item should be add in the udev
rules file to match
s/n?
$ udevadm info -a -p /sys/block/sda/sda7
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/block/sda/sda7':
    KERNEL=="sda7"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{partition}=="7"
    ATTR{start}=="177903873"
    ATTR{size}=="798864192"
    ATTR{alignment_offset}=="0"
    ATTR{discard_alignment}=="3402497536"
    ATTR{stat}=="     432      339     6232     5180   337440     7926
40492672  6625648        0   980628  6630664"
    ATTR{inflight}=="       0        0"

  looking at parent device '/block/sda':
    KERNELS=="sda"
    SUBSYSTEMS=="block"
    DRIVERS==""
    ATTRS{range}=="16"
    ATTRS{ext_range}=="256"
    ATTRS{removable}=="0"
    ATTRS{ro}=="0"
    ATTRS{size}=="976773168"
    ATTRS{alignment_offset}=="0"
    ATTRS{discard_alignment}=="0"
    ATTRS{capability}=="50"
    ATTRS{stat}=="   59304     9490  2333535   463744   521540
1855677 56765056 22669884        0  1334564 23147264"
    ATTRS{inflight}=="       0        0"

thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux