Operating Systems > Linux and UNIX

non-destructive partition resizing

(1/2) > >>

Master of Reality:
which program do i use to resize a partition in Linux without destroying the data (from the console).

voidmain:
Depends on the file system type.  If you are using ext2 then use "resize2fs" see "man resize2fs".  I am not sure but since ext2 and ext3 use the same format I believe it should work on ext3 as well.  But check for more info on this first as I am not sure. I can do some digging on this if you can't find any info. If you run reiserfs then use "resize_reiserfs" and see "man resize_reiserfs".

Note, the above resizes the "file system".  If you are wanting to enlarge the file system then you first must run "fdisk" and delete the existing partition, then recreate the partition at the same starting cylinder but make the ending cylinder beyond the old ending cylinder (requires enough contiguous free space after the partition you want to enlarge).  Then you can enlarge your file system using the above utilities.  

If you want to shrink the partition, first shrink the file system using the above utilities, then delete the partition and create a new partition on the same starting cylinder but put the ending cylinder at the end of your filesystem (or just beyond the end).

[ August 15, 2002: Message edited by: VoidMain ]

Sleeping Dog:
I am not exactly positive about this, but isn't there a utility called "Partition Magic" or something similar that will allow you to resize partitions by booting from a floppy.  I seem to recall using such a thing a while back.  I think that it ran under it's own DrDOS from boot.

There may still be some downloadable utilities from certain HD manufacturer websites that will also allow you to do what you want to do.

If this ability is not built into your version of LINUX, you may want to try a Google Advanced search on "non-destructive partition resizing" with "LINUX" as your must include keyword.

Hope this little bit helps.

Sleeping Dog

Master of Reality:
i need to make a filesystem and partition bigger.
I have hda1 2GB and then directly after that is /dev/hda2 which is my swap. If i jsut delete then remake hda1 bigger and move the swap back farthur will slackware still find the swap and use it since it didnt change partition numbers?

Master of Reality:
how am i supposed to resize my partition if you cant run resize2fs on a mounted partition. Should i use a cdrom/floppy based distro to do it, like knoppix or tomsrtbt?

Navigation

[0] Message Index

[#] Next page

Go to full version