Click to See Complete Forum and Search --> : Partition Issue


Professor
10-02-2003, 05:56 PM
I have 3 partitions on my computer, a 60Gb one for XP (which i'm hoping to get rid of), one 30Gb NTFS partition - backup and misc files, and one 30Gb partition for Linux. I would like to see about adding the 30Gb misc paritition to Linux for my Home directory. I know that i'll need to convert it to ext2, but i don't know how to do that in Linux.

Thanks in advance for any advice / help

AMD Dual MP 1600+
RH9 2.4.20-20.9
2.4.22 In Process (working on rebuilding the kernel with network support)
512 Mb DDR 2100
120Gb Western Digital
DSL

phil_r
10-03-2003, 09:54 AM
I don't think it needs to be ext2, you could do it as FAT32 but if it's NTFS you're screwed because writing to NTFS is "dangerous".

So assuming you've got the filesystem sorted ok, just alter your /etc/fstab to point /home to whichever partition it is - probably hda2 from your description.

I'm at work so can't test the theory but I believe that should do it.

Phil.

Professor
10-03-2003, 10:01 AM
I'll test this tonight when i get home. I was wanting to get rid of the NTFS partitions and create a linux native partition such as ext2 and put the home directory there, didn't know how to do that. i managed to remove the NTFS partitions, but for some reason, when i use the parted command, i get an error message stating that /dev/hdc5 (current / directory) was not unmounted cleanly. I wonder if this happened when i used fdisk to delete the partitions /hdc1 and /hdc2. I then get a message that i need to run e2fsck on /hdc5. i would like to do that, but first i would like to get the information from the /home moved to the larger 90Gb partition. Currently my partition table looks like this:

/dev/hdc3 boot
/dev/hdc4 extended
/dev/hdc5 /
/dev/hdc6 swap

Icarus
10-03-2003, 11:01 AM
I'll guess the 30gb partition is /dev/hdc2? well, we'll use that as a starting point ;)

The best thing to do is backup that partition and remove it, delete, erase...then make a new ext3 (you are using ext3 not ext2 right? ext2 is very old and has been made oboliete by ext3, most distros these days default to ext3)

Once you hav that made you will want to mount it in a temp mount point, you can use the cdrom mount point for this

mount -t ext3 /dev/hdc2 /mnt/cdrom

Then, as root copy the entire /home to the new drive

cp -rpv /home /mnt/cdrom

verify that everything under /mnt/cdrom looks just like under /home then umount /mnt/cdrom
make an entry in /etc/fstab for the new /home directory

/dev/hdc2 /home ext3 defaults 0 0

At this point, be sure there are no users besides root logged on. then mount the new /home partition, this will mount over the existing /home so the data there will still be safe for now.
Now if you do a "df -h" you should see /home mount from /dev/hdc2.
I suggest to reboot at this point and verify that /home mounts correctly and it is using the /dev/hda2 partition.

Once you verify that everything is OK now, unmount /home and you should see the original /home directory (verify with "df -h" and check the time stamps) then you can "rm -rf /home/*"
Then mount /home and you should be all set!

Professor
10-03-2003, 11:05 AM
Thanks very much for all of the details. Now i can hardly wait to get home to try it. I'll keep you posted on whether or not i was successful. Also thanks for clearing up the ext2 / ext3 dilema that i had, didn't know which one i should use.

Icarus
10-03-2003, 11:14 AM
I'll clean it later when I have more time today, just to make it more readable... ;)

Any that will give time for anyone to correct my mistakes :D

Professor
10-04-2003, 07:05 PM
Thanks everyone for all of the help. I finally got everything set up on the correct partitions. I have the 90 Gb partition (60 NTFS + 30 NTFS partition merged into one ext3 parititon) as the home directory, and the other 30 Gb for all other partitions except for boot and swap.