LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Resizing Ext3 partition to replace XP (https://www.linuxquestions.org/questions/linux-general-1/resizing-ext3-partition-to-replace-xp-282436/)

Sigmund 01-26-2005 07:55 AM

Resizing Ext3 partition to replace XP
 
I've been dual-booting XP and Ubuntu for some time now. Whenever my XP install started giving me too many problems to be worth correcting I would just format the ntfs partition and start over. While preparing to reformat for the 3rd time since I installed Ubuntu I noticed that I usually boot into linux for a while when I'm getting the motivation to go through the painstaking process of reinstalling all my stuff and it really didn't make sense for me to keep it up. In short, I'm sick of windows, I don't really need to dual boot anymore and I was wondering if there is a way to increase my root partition (my only mount point besides swap) to take up the entire disk. Or, if its possible to format the xp install, and mount the space as my home directory without losing my settings and such.

Any suggestions of methods or utilities to do this would be appreciated,
Sigmund

acid_kewpie 01-26-2005 08:05 AM

the /home idea is MUCH better than wanting to expand your root partition. for example. you might want to reinstall ubuntu if it all goes horribly wrong somewhere. you're /home partition is physically seperate form the base system, so you can leave /home alone, and format / only. then on your shiny new system, just mount the /home partitino and instantly all your own media files, settings etc... are there, ready and able.

so... to do this is really easy. just go into fdisk (or cfdisk for a nicer interface) and change the partition type from ntfs to linux ext2 (type 83 afaik) then use
Code:

mke2fs -j /dev/hda1
to create an ext3 system on it. then mount it somewhere temporarily, e.g. /mnt/home (create that directory) and then copy everything over. personally i recommend not just using cp, but other people have no problem. so i say do:
[code]find /home | cpio -pvd /mnt
Code:

this will create a clone of /home and /mnt/home. then just mount it at /home and you're done. well, done other than unmounting /home and deleting all the old data once you're happy with it. The only other thing is to add an entry to /etc/fstab to make it always mount it automatically:
/dev/hda1  /home  ext3    defaults  0 0

all done.

acid_kewpie 01-26-2005 08:05 AM

that's assuming windows was on /dev/hda1 of course!

Sigmund 01-26-2005 08:22 AM

Thanks a lot, that was insanely fast.
First time I've ever posted here btw.

Your response leads me to another question though. /hda2 is actually my ntfs partition, /hda1 is what I boot to and contains my bootloader. What would be the cleanest way to take care of the fact that I no longer need to make a decision at boot time? Setting a default with no wait time seems pretty sloppy though I think it would probably work fine.

Thanks,
Sigmund

acid_kewpie 01-26-2005 08:44 AM

what bootloader is this? what happens after you get that bootloader? do you have lilo or grub after that? or is hda1 actually the linux /boot partition?

you WILL still need a bootloader for linux, linux never just hurls straight into it. although ubuntu does use a pretty minimal install of grub, no splash screen or anything, so maybe you're just not aware it's grub at all.

Sigmund 01-26-2005 09:08 AM

to clarify
/boot is mounted on hda1
I believe it is grub, I usually get a menu with a few options: xp, ubuntu, ubuntu rescue and a memory test. How would I go about editing the contents of the menu permanently? To remove the xp entry and maybe lower the wait period.

Thanks,
Sigmund

acid_kewpie 01-26-2005 09:24 AM

ahh right, that's a lot lot nicer. yeah, edit /boot/grub/grub.conf and just wop out the XP entry. that's all you need to do... try that before nuking hda2 if you want...

Sigmund 01-26-2005 10:48 AM

I followed all of the steps in your first response and everything seemed to work fine, tons of free space now. Though you mentioned deleting the old /home directory and I'm not sure how to do that now that I have the new one mounted. Do I need to boot without X, unmount the current /home (i updated fstab as well) so that the old one is accessible and delete it there? I'm not sure how to go about it in Ubuntu since I can't log in as root, if that is the case.

Thanks,
Sigmund


All times are GMT -5. The time now is 03:25 PM.