Click to See Complete Forum and Search --> : Repartition a running HD


satimis
06-30-2006, 10:38 AM
Hi folks,

FC5_64

Is it possible to repartition an existing HD of of 80G with following setup;

# fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1734 13823932+ 83 Linux
/dev/sda3 1735 3008 10233405 83 Linux
/dev/sda4 3009 4283 10241437+ 5 Extended
/dev/sda5 3009 3262 2040223+ 82 Linux swap / Solaris

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 9.5G 5.1G 4.0G 57% /
/dev/sda1 99M 14M 81M 15% /boot
tmpfs 500M 0 500M 0% /dev/shm
/dev/sda2 13G 3.6G 8.6G 30% /home

Steps to be performed as follows;
1) run "mkfs.ext3 /dev/sda4" to make filesystem
2) move /home from /dev/sda2 to /dev/sda4
3) delete /dev/sda2 with fdisk
4) re-create following partitions;
/dev/sda2 logical 5G
/dev/sda6 ext 10G
/dev/sda7 ext 10G
/dev/sda8 ext remaining size


Which runlevel will be more suitable to do the job, starting "init 1" or "init 3" at boot?

Please advise. TIA

B.R.
satimis

IsaacKuo
06-30-2006, 04:08 PM
I'm not familiar with trying to repartition a drive that's actually in use. Whenever I want to repartition, I either use a liveCD like Knoppix, or my Debian install CD.

cybertron
06-30-2006, 06:30 PM
I would second the suggestion to use a live CD of some sort to do this. Although I guess it's possible to do what you want to since I don't see anywhere in there that you're trying to change your root partition, which you can't do because you can't unmount it and you can't repartition it while it's mounted. That means you have to unmount any other partitions that you are going to make changes to. Even then I'm not positive it will let you do it, hence the live CD suggestion.

Honestly I don't think it matters which runlevel you do it from as long as the partitions you are changing are not mounted. You can do it from runlevel 5 with QTParted if you like or any other runlevel as far as I know.

Also, and I'm sure you already know this but a reminder never hurts, make a backup of anything you don't want to lose. Usually repartitions go fine, but if your luck is as bad as mine you'll be very glad you had a backup.

satimis
06-30-2006, 08:51 PM
Hi folks,

Tks for you advice.

I'll wide out the whole HD using a LiveCD and repartition it in a more logical manner making way for multi-boot. This PC is for test purpose. I have backup;

1) /boot (/dev/sda1)
2) / (/dev/sda3)
3) /home (/dev/sda2)
4) Data

separately as compressed tarballs, .tar.bz2. Data has been restored to another PC.
After repartition I'll restore them to their respectively partitions to see whether this backup method will work instead of using those backup software, bacula, rdiff, mondo, etc. I also has a boot floppy to boot this PC.

B.R.
satimis

StarKnight83
07-01-2006, 04:25 PM
actually i dont believe its possible to do to a disk that is inuse (mainly cause to the way the partition table is handled) formating fs and alterdata are one thing but altering how the system sees a disk is another

saikee
07-07-2006, 07:10 AM
Few points I pick up here

(1) Sda4 is an extended partition and has no storage space inside. It is just a border prescribing the begining and finishing addresses of the logical partitions. Thus the original scheme of moving the content of sda2 to sda4 will never work.

(2) One may consider housing the entire distro in a single partition. It really saves a lot of bother. Personal data will be best hosued separately in a Fat32 partition accessible (in both read and write) by Windows and Linux without any trouble.

satimis
07-08-2006, 12:03 AM
Hi folks,

Tks for your advice.

Since this box is for testing purpose, before erasing the partitions I'll resize partition, move /home etc. to absorb some experience.

B.R.
satimis