get_unused_blockdev_info can return used blockdevices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
Confirmed
|
Medium
|
Unassigned |
Bug Description
get_unused_
That does not always work right on trusty.
example:
$ sudo mount /dev/vdb1 /mnt
$ sudo PYTHONPATH=$PWD python -c 'from curtin import block; print(block.
{'vdb': {'GROUP': 'disk', 'OPT-IO': '0', 'DISC-MAX': '0', 'LABEL': '', 'MODEL': '', 'RQ-SIZE': '128', 'MODE': 'brw-rw----', 'ROTA': '1', 'RM': '0', 'RO': '0', 'device_path': '/dev/vdb', 'DISC-ZERO': '0', 'UUID': '', 'STATE': '', 'MOUNTPOINT': '', 'FSTYPE': '', 'SIZE': '42949672960', 'MAJ:MIN': '253:16', 'DISC-GRAN': '0', 'NAME': 'vdb', 'LOG-SEC': '512', 'DISC-ALN': '0', 'ALIGNMENT': '0', 'MIN-IO': '512', 'OWNER': 'root', 'KNAME': 'vdb', 'TYPE': 'disk', 'PHY-SEC': '512'}}
$ cat /proc/mounts
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,
proc /proc proc rw,nosuid,
udev /dev devtmpfs rw,relatime,
devpts /dev/pts devpts rw,nosuid,
tmpfs /run tmpfs rw,nosuid,
/dev/disk/
none /sys/fs/cgroup tmpfs rw,relatime,
none /sys/fs/
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/
none /run/lock tmpfs rw,nosuid,
none /run/shm tmpfs rw,nosuid,
none /run/user tmpfs rw,nosuid,
none /sys/fs/pstore pstore rw,relatime 0 0
systemd /sys/fs/
/dev/vdb1 /mnt ext4 rw,relatime,
Note, this works correctly on wily, lsblk does thh right thing.