Author Topic: non-destructive partition resizing  (Read 688 times)

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
non-destructive partition resizing
« on: 16 August 2002, 00:29 »
which program do i use to resize a partition in Linux without destroying the data (from the console).
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
non-destructive partition resizing
« Reply #1 on: 16 August 2002, 00:36 »
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 ]

Someone please remove this account. Thanks...

Sleeping Dog

  • Member
  • **
  • Posts: 158
  • Kudos: 0
non-destructive partition resizing
« Reply #2 on: 16 August 2002, 00:36 »
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

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
non-destructive partition resizing
« Reply #3 on: 21 September 2002, 23:30 »
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?
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
non-destructive partition resizing
« Reply #4 on: 22 September 2002, 06:40 »
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?
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
non-destructive partition resizing
« Reply #5 on: 22 September 2002, 07:45 »
i figured it out.
I ran virtual linux off a CD and then ran e2fsck -f /dev/hda1 then ran resize2fs /dev/hda1 691323 (or whatever the block size was) and then rebooted into slackware and fan fsck on it again.
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
non-destructive partition resizing
« Reply #6 on: 23 September 2002, 20:49 »
i think the newest partition magic does Ext3.

I use Linux fdisk though of course.
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'