Tuesday, July 13, 2010

How to resize uml file system

the original link is http://user-mode-linux.sourceforge.net/old/resize.html

  • Shut down the uml guest
    UML# halt
  • Make a backup of the file you want to resize.
  • If you have any COW files which have the file you want to resize as a backing file then make a backup of the cow files, too.
  • If you want to merge the cow file with uml_moo, do it now. Otherwise remove the cow file to avoid confusion.
  • Make sure the filesystem is in a clean state.
    host% e2fsck -f filename
  • Resize the file.
                      
    host%
    dd if=/dev/zero of=filename bs=1 count=1 seek=newsize conv=notrunc

    0+0 Records in
    0+0 Records out

    newsize can be any size recognized by "dd", such as "256M", "4G", or "2T". The length of the file should have changed, but not the actual filesize as with "ls -ls".
  • Resize the filesystem.
    host% resize2fs -p filename
  • If you don't trust your luck and/or your computer run:
    host% e2fsck -f filename
  • Start the uml with the new filesystem

No comments:

Post a Comment