All of lore.kernel.org
 help / color / mirror / Atom feed
* /sys/block and /dev and partitions
@ 2015-08-15 11:16 Loic Dachary
  2015-08-15 14:28 ` Sage Weil
  0 siblings, 1 reply; 10+ messages in thread
From: Loic Dachary @ 2015-08-15 11:16 UTC (permalink / raw)
  To: Ceph Development

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-08-18 10:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-15 11:16 /sys/block and /dev and partitions Loic Dachary
2015-08-15 14:28 ` Sage Weil
2015-08-15 15:35   ` Loic Dachary
2015-08-15 17:42     ` Ilya Dryomov
2015-08-15 20:56       ` Loic Dachary
2015-08-15 22:00         ` Ilya Dryomov
2015-08-15 22:10           ` Loic Dachary
2015-08-17 21:46             ` Loic Dachary
2015-08-18  9:53               ` Ilya Dryomov
2015-08-18 10:13                 ` Loic Dachary

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.