← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~blair/cloud-init/cloud-init into lp:cloud-init

 

The proposal to merge lp:~blair/cloud-init/cloud-init into lp:cloud-init has been updated.

Commit Message changed to:

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.

For more details, see:
https://code.launchpad.net/~blair/cloud-init/cloud-init/+merge/143347
-- 
https://code.launchpad.net/~blair/cloud-init/cloud-init/+merge/143347
Your team cloud init development team is requested to review the proposed merge of lp:~blair/cloud-init/cloud-init into lp:cloud-init.


References