diff options
author | Blair Zajac <blair@orcaware.com> | 2013-01-28 14:10:56 -0800 |
---|---|---|
committer | Blair Zajac <blair@orcaware.com> | 2013-01-28 14:10:56 -0800 |
commit | 0612a35c4190a485a95ebade8f5c0598ae8b0e14 (patch) | |
tree | e3cbf23bfef4e21397e31b57ef65b823a4d4e5c5 /ChangeLog | |
parent | bf7bdf27e109ffb4964d4869b79da964fc40fb65 (diff) | |
download | vyos-cloud-init-0612a35c4190a485a95ebade8f5c0598ae8b0e14.tar.gz vyos-cloud-init-0612a35c4190a485a95ebade8f5c0598ae8b0e14.zip |
Support resizing btrfs filesystems.
The existing code has two issues with btrfs:
1) The command to resize a btrfs filesystem uses a path to the mount
point, not the underlying device:
$ btrfs filesystem resize max /dev/vda1
ERROR: unable to resize '/dev/vda1' - Inappropriate ioctl for device
Resize '/dev/vda1' of 'max'
$ btrfs filesystem resize max /
Resize '/' of 'max'
2) The code that is given a path and finds the ID of the device where
the path is mounted doesn't work for btrfs:
Use /proc/$$/mountinfo to find the device where path is mounted.
This is done because with a btrfs filesystem using os.stat(path)
does not return the ID of the device.
Here, / has a device of 18 (decimal).
$ stat /
File: '/'
Size: 234 Blocks: 0 IO Block: 4096 directory
Device: 12h/18d Inode: 256 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2013-01-13 07:31:04.358011255 +0000
Modify: 2013-01-13 18:48:25.930011255 +0000
Change: 2013-01-13 18:48:25.930011255 +0000
Birth: -
Find where / is mounted:
$ mount | grep ' / '
/dev/vda1 on / type btrfs (rw,subvol=@,compress=lzo)
And the device ID for /dev/vda1 is not 18:
$ ls -l /dev/vda1
brw-rw---- 1 root disk 253, 1 Jan 13 08:29 /dev/vda1
So use /proc/$$/mountinfo to find the device underlying the input
path.
Diffstat (limited to 'ChangeLog')
0 files changed, 0 insertions, 0 deletions