Difference between revisions of "Resize-rootfs"

From VNUML-WIKI
Jump to: navigation, search
 
Line 1: Line 1:
 
<h1 class="firstHeading">Resizyng a root-file-system</h1>
 
<h1 class="firstHeading">Resizyng a root-file-system</h1>
  
# Increasing the size of a root-file-system:
+
<ol>
 +
<li>Increasing the size of a root-file-system:
 
   e2fsck -f root_fs_tutorial-0.31
 
   e2fsck -f root_fs_tutorial-0.31
 
   dd if=/dev/zero of=root_fs_tutorial-0.31 bs=1 count=1 seek=550M conv=notrunc
 
   dd if=/dev/zero of=root_fs_tutorial-0.31 bs=1 count=1 seek=550M conv=notrunc
 
   resize2fs -p root_fs_tutorial-0.31
 
   resize2fs -p root_fs_tutorial-0.31
 
   e2fsck -f root_fs_tutorial-0.31
 
   e2fsck -f root_fs_tutorial-0.31
# Downsizyng a rootfilesystem:
+
</li>
 +
<li>Downsizyng a rootfilesystem:
 
* Create a new rootfilesystem with the size you want your filesystem to have:
 
* Create a new rootfilesystem with the size you want your filesystem to have:
 
> dd if=/dev/zero of=newfs bs=1 count=1 seek=1200M conv=notrunc
 
> dd if=/dev/zero of=newfs bs=1 count=1 seek=1200M conv=notrunc
Line 16: Line 18:
 
> umount /mnt/old
 
> umount /mnt/old
 
> umount /mnt/new
 
> umount /mnt/new
 +
</li>
 +
<ol>

Revision as of 03:01, 15 October 2006

Resizyng a root-file-system

  1. Increasing the size of a root-file-system: e2fsck -f root_fs_tutorial-0.31 dd if=/dev/zero of=root_fs_tutorial-0.31 bs=1 count=1 seek=550M conv=notrunc resize2fs -p root_fs_tutorial-0.31 e2fsck -f root_fs_tutorial-0.31
  2. Downsizyng a rootfilesystem:
    • Create a new rootfilesystem with the size you want your filesystem to have:
    > dd if=/dev/zero of=newfs bs=1 count=1 seek=1200M conv=notrunc > mkfs -t ext2 newfs
    • Copy the old filesystem content to the new one:
    > mount -o loop oldfs /mnt/old/ > mount -o loop newfs /mnt/new > cp -a /mnt/old/* /mnt/new/ > umount /mnt/old > umount /mnt/new