/sys/block and /dev and partitions

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

 



Hi,

Is there a portable and consistent way to figure out if a given /dev/XXX path (for instance /dev/dm-1) is a partition of a whole device ? Although checking /sys/block/dm-1/dm/name for a number at the end (like mpatha1 or mpatha2) would probably work, it feels like a fragile hack. Looking into /sys/block/dm-1/slaves will lead to /sys/block/dm-1/slaves/dm-0 and we can check that /sys/block/dm-*/subsystem is class/block. But that does not necessarily mean dm-1 is a partition of dm-0, just that it's a slave of dm-0. 

Any idea ?

Cheers
-- 
Loïc Dachary, Artisan Logiciel Libre

Attachment: signature.asc
Description: OpenPGP digital signature


[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