← Back to team overview

cloud-init-dev team mailing list archive

Re: Resizing of a GPT partition

 

Scott,


> > Hi all,
> >
> > I've fiddled around with cc_resizefs.py trying to resize a GPT root
> > partition (2nd partition) but I can't get it to work. Any ideas how to
> > do that? Is it possible at all?
> 
> Its not configurable at the moment.  Thats not to say that it couldn't be,
> but the code as it is right now just attempt to resize the device that
> '/'
> is on.
> 
> It just does:
>     st_dev = os.stat("/").st_dev
>     dev = os.makedev(os.major(st_dev), os.minor(st_dev))
>     os.mknod(devpth, 0400 | stat.S_IFBLK, dev)
> 
>     cmd = ['blkid', '-c', '/dev/null', '-sTYPE', '-ovalue', devpth]
> 
> So whatever dev major and minor / is on it should attempt to resize.

I understand what the code is doing. I launched a precise-*-disk1.img cloud image in Nova and noticed that cloud-init correctly resized the root partition to 10GB. What puzzles me is that I don't see a resizing of the root partition before the filesystem is resized. Isn't that a necessity?

...Juerg


> It just gets the device by os.stat("/") because that was the most reliable
> way I could think to get the device name of /, independent of root=.



Follow ups

References