how btrfs uses devid?

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

 



Dear all:

If a btrfs device is missing, the command tool tells user the devid of
the missing devices.

I understand that each device (disk) in a btrfs volume has been
assigned a uuid (UUID_SUB field in udevadm info output). If the device
is missing, it's hard to tell user to input such uuid string in
command line. So devid is for convenience.

In our product, we want to record all disk information of a volume in
a file. If a disk is missing, not because it's broken, but because the
user has so many disks and in some cases they may put back the wrong
one. In this scenario, we can provide the disk information (such as
serial number) to user and help them to check if they did something
wrong.

My question is: is the devid just an alias to sub uuid? for a given
disk device, it is never changed during any btrfs operation, including
add, remove, balance and replace? or it may be changed, and when?

One more question just for curiosity. I checked the source code of
btrfs-progs briefly. It seems that there is no data structure in
superblock recording all sub-uuids or all devids for the volume, so
how does btrfs figure out the missing devid? since they are not always
sequential integers, for example, after one device is removed, the
devid is simply removed and the devid of other device is not
re-numbered.

matianfu
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux