[systemd-devel] [PATCH] rules: add by-parttypeuuid rule for GPT labeled partitions

Karel Zak kzak at redhat.com
Tue May 13 02:53:43 PDT 2014


On Mon, May 12, 2014 at 05:18:56PM +0200, Kay Sievers wrote:
> > I just looked up libudev and it looks like there is even a pyudev wrapper,
> > so that could indeed work better.  I take it that queries via
> > udev_enumerate for (say) ID_PART_ENTRY_TYPE=x are efficient?
> 
> Sure, filter for "block" devices and this or other GPT properties. The
> libudev API will just find the devices is /sys and read the database
> files in tmpfs /run and, it will not talk to any devices, so it should
> perform pretty well.

 and on command line lsblk(8) reads the info from udev db, so you can
 use:

 $ lsblk -o+PARTTYPE
 NAME   MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT PARTTYPE
 sda      8:0    0 149.1G  0 disk
 ├─sda1   8:1    0  1000M  0 part  /boot      c12a7328-f81f-11d2-ba4b-00a0c93ec93b
 ├─sda2   8:2    0     2G  0 part             ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
 ├─sda3   8:3    0   9.7G  0 part  [SWAP]     0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
 ├─sda4   8:4    0  34.2G  0 part  /          ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
 ├─sda5   8:5    0  63.2G  0 part  /home      ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
 └─sda6   8:6    0  39.1G  0 part             ebd0a0a2-b9e5-4433-87c0-68b6b72699c7


(well, this is from git tree, will be in v2.25 :-)

    Karel

-- 
 Karel Zak  <kzak at redhat.com>
 http://karelzak.blogspot.com


More information about the systemd-devel mailing list