Difference between revisions of "Resize-rootfs"
Line 2: | Line 2: | ||
<ol> | <ol> | ||
− | <li>Increasing the size of a root-filesystem: | + | <li>Increasing the size of a root-filesystem:</li><br> |
− | </li> | ||
> e2fsck -f root_fs_tutorial-0.31 | > e2fsck -f root_fs_tutorial-0.31 | ||
Line 18: | Line 17: | ||
> 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 | ||
> mkfs -t ext2 newfs | > mkfs -t ext2 newfs | ||
+ | |||
+ | <br> | ||
<li>Copy the old filesystem content to the new one:</li><br> | <li>Copy the old filesystem content to the new one:</li><br> | ||
Line 26: | Line 27: | ||
> umount /mnt/old | > umount /mnt/old | ||
> umount /mnt/new | > umount /mnt/new | ||
+ | |||
+ | <br> | ||
</ul> | </ul> | ||
</ol> | </ol> |
Revision as of 02:10, 15 October 2006
Resizing a root-filesystem
- Increasing the size of a root-filesystem:
- Downsizing a root-filesystem:
- 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:
> 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
> mount -o loop oldfs /mnt/old/ > mount -o loop newfs /mnt/new > cp -a /mnt/old/* /mnt/new/ > umount /mnt/old > umount /mnt/new