LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Wiping windows out and expanding linux partition (http://www.linuxquestions.org/questions/linux-general-1/wiping-windows-out-and-expanding-linux-partition-288167/)

geomatt 02-09-2005 12:32 PM

Wiping windows out and expanding linux partition
 
Hi everyone.

I've been dual booting with slackware and windows xp for over a year and I am ready to dump windows from my laptop. I love slack and never use windows so the 10 gigs on my windows partition is just wasted space.

I know that the easy way to do it would be to a full reinstall (especially since Slackware 10.1 has just come out!) But I have been tweaking slack 10.0 for such a long time and I've got it right where I want it, with all kinds of extra software, and a 2.6.8 kernel, so I'd rather try to expand the linux partitions to overrun the windows ones. Unfortunately things are pretty complicated on my machine so I don't know how to do it.

First off, it's an IBM thinkpad with some kind of hidden Windows partition where it keeps a
backup of the original configuration of the os and software it came with (must be so there are no cd's of xp around to pirate), then I am using Boot Magic boot loader which enables me to choose between xp and linux and it resides on its own FAT partition, then there is the ntfs windows XP partition and linux root, home and swap partitions.

Booting the machine first runs boot magic and choosing linux then calls up lilo.

Can anybody out there give me some advice on what to do with this complicated mess, so I can wipe out windows and get as much space as possible for linux without having to do a reinstall? I know I don't really need two boot loaders, and I don't really care about keeping the hidden partition with a compressed version of the factory installed software on it, but I am not sure what is feasible with this setup.

Here's the output of fdisk -l:
Code:

Disk /dev/hda: 36.7 GB, 36757301760 bytes
240 heads, 63 sectors/track, 4748 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1              8        1091    8195008+  17  Hidden HPFS/NTFS
/dev/hda2              1          7      52888+  1b  Hidden W95 FAT32
/dev/hda3  *        1092        2446    10243800  83  Linux
/dev/hda4            2447        4748    17403120    f  W95 Ext'd (LBA)
/dev/hda5            2447        2582    1028128+  82  Linux swap
/dev/hda6            2583        4748    16374928+  83  Linux

Partition table entries are not in disk order

Can anyone help me figure out what the best approach would be? My usual approach is just to try something and then fix my mistakes, but this time I wanna be a bit more careful.

-Geo

Matir 02-09-2005 03:00 PM

hda3 and hda4 can easily be merged, but other than that, it will be hard to gain any more space. if you want to do this, you need to be VERY careful.

Step 1. MAKE A BACKUP
Step 2. CHECK YOUR BACKUP

Step 3. In fdisk, delete the /dev/hda4 partition. Change the ending cylinder of /dev/hda3 to be the same as the old ending cylinder of /dev/hda4. After writing your partition table, use resize2fs or a similar utility to resize your file system.

There are LOTS of howtos on doing this online, I reccomend you read many of them and ask lots of questions. This process can easily damage your partition table and existing file structure.

geomatt 02-09-2005 05:30 PM

Thanks for the reply.
Unfortunately it's hda1 that I am after since it has all of the space. I 'll keep doing my reading.... Can you point me to any of the howto's you mention? Maybe I'll just have to reinstall from scratch. :(

-Geomatt

syg00 02-09-2005 08:39 PM

Why do you need to expand into the space ???.
Reformat the partition (hda1), and create a mount point for it.
As for the 2 bootloaders, why screw with something that works - just set a low timeout value.

geomatt 02-09-2005 09:50 PM

Yes that makes sense. I guess the reason I wanted to expand into the space was so I didn't have to mess with the file system. I didn't have anything in particular I wanted to put there - just wanted room to grow....

Thanks

-geomatt

amosf 02-09-2005 10:49 PM

Show us a df output...

You could set it up to put /home on hda1, or if you already have /home you could use it for

/home/username/files

or

/usr/local/games/

or whatever you want the space for...

geomatt 02-09-2005 11:48 PM

Sure, here is what df returns:
Code:

Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/hda3              9922672  6332136  3078348  68% /
/dev/hda6            15861848  10490468  4552636  70% /home
/dev/hda1              8195008  4985400  3209608  61% /mnt/windoze

Where I need most space is in my user files - music, photos, etc. So am I right in thinking I could just change the file system type of the ntfs partition (/dev/hda1) to ext2 and then add an fstab entry that mounts it as say /mnt/mystuff. Then I could move my music, for example, over there and symlink to it the new location from the old music directory so my programs can find it? (I know this stuff is basic, just wanna make sure I get what the right way to do it is :D).

Cheers,
geomatt

amosf 02-10-2005 01:24 AM

Yep. I have like /media directories and stuff. You may just need to fiddle around with the permissions and mount options to give yourself write permission...

geomatt 02-10-2005 06:55 AM

OK, I'll try something like that and will post any problems I have.

Thanks for the help!

-geo

geomatt 02-11-2005 05:39 PM

Well, I'm ready to get rid of windows.

I'll follow syg00's suggestion and just change /dev/hda1 to ext2. The only question remaining is - how? Should I just use cfdisk - will that be sufficient to create a new linux file system on the partition? Should I use mkfs? Or some other utility? Anyone have preferences or recommendations? Also - one more thing: this seems not to be a terribly risky parition change - I'm not resizing anything or moving anything - or I am wrong? I will back up the system first, but is there anything else I should know before wiping the ntfs partition and changing it to linux? My worry is about booting up - boot magic works from its own partition I believe, but can only be configured from windows xp. So I figure I won't be able to change anything afterwards (like how long before windows doesn't load), but will anything else likely be screwed up in the process?

For reference here is the output from fdisk -l once again:
Code:

Disk /dev/hda: 36.7 GB, 36757301760 bytes
240 heads, 63 sectors/track, 4748 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1              8        1091    8195008+  17  Hidden HPFS/NTFS
/dev/hda2              1          7      52888+  1b  Hidden W95 FAT32
/dev/hda3  *        1092        2446    10243800  83  Linux
/dev/hda4            2447        4748    17403120    f  W95 Ext'd (LBA)
/dev/hda5            2447        2582    1028128+  82  Linux swap
/dev/hda6            2583        4748    16374928+  83  Linux

Partition table entries are not in disk order

Thanks,
-geo

syg00 02-11-2005 06:59 PM

Quote:

Originally posted by geomatt
Well, I'm ready to get rid of windows.

I'll follow syg00's suggestion and just change /dev/hda1 to ext2. The only question remaining is - how? Should I just use cfdisk - will that be sufficient to create a new linux file system on the partition? Should I use mkfs?
You'll need to do both [c]fdisk creates the partition table entry, not the filesystem.
Quote:

but is there anything else I should know before wiping the ntfs partition and changing it to linux? My worry is about booting up - boot magic works from its own partition I believe, but can only be configured from windows xp. So I figure I won't be able to change anything afterwards
Didn't realize the boot magic dependancy - in that case I'll amend my previous recommendation. Seeing as how you are sure about this, I'd be inclined to install a Linux bootloader into the MBR before you start - lilo in your case, although I prefer grub.
Lose boot magic.
When happy, trash the XP partition - now you have the option to delete both that and the boot magic partition and make one combined.

geomatt 02-12-2005 08:28 AM

Quote:

I'd be inclined to install a Linux bootloader into the MBR before you start - lilo in your case, although I prefer grub.
That makes things a bit more interesting, especially since this is getting into unfamilar territory for me. I am right in thinking that there is only one MBR right at the beginning of the hard disk, and that boot magic is located there? It then tranfers control to lilo when I choose to boot linux and lilo is located in the beginning of my root linux partition, sort of in a fake MBR? (BTW the reason for the complex setup is that I used partition magic from within widows xp to repaprtition the disk for dual booting with linux and the complicated setup was what the documentation suggested was the way to get xp to play nicely with linux.) Can you give me a sense of what exacly I need to do to install lilo to the MBR? I'll read as much of the documentation as I can get my hands on, but an overview of what to expect would help me see what I am getting into.

Thanks,
geo

geomatt 02-12-2005 04:37 PM

ok. Some new discoveries:
1. the software recovery image that IBM provides on its laptops seems to be stuck on the end of the drive and can be disabled in the BIOS - that frees up 6 whole gigs of space. That is now freespace at the end that I can turn into linux space - not sure how yet. That'll be another thread if I can't find out ;)
2. I think I figured out how to reinstall lilo on the MBR:
just edit lilo.conf changing "boot=/dev/hda3" to "boot=/dev/hda" and then run lilo again. That will put lilo on the MBR right? And my existing filesystem should be mounted at bootup as long as the rest of the lilo.conf file is the same, right?

-geomatt

syg00 02-12-2005 06:22 PM

Quote:

Originally posted by geomatt

2. I think I figured out how to reinstall lilo on the MBR:
just edit lilo.conf changing "boot=/dev/hda3" to "boot=/dev/hda" and then run lilo again. That will put lilo on the MBR right? And my existing filesystem should be mounted at bootup as long as the rest of the lilo.conf file is the same, right?

I would expect so, although I haven't run lilo for years.
If there are problems, ain't the end of the world. You might want to check if the Slack CD can run in recovery mode - if so fix it from there, else use something like Knoppix.

geomatt 02-13-2005 08:49 AM

Well, after much reading and with some trepidation, and following your suggestion that it should work - though I would not have blamed you if it didn't :D - I got lilo on the MBR by editing lilo.conf. Changed boot=/dev/hda3 to boot=/dev/hda. Ran lilo. Now I boot directly into linux. Bye, bye windoze! Now I must figure out how to recolonize all of that space occupied by M$ stuff.

Cheers, and thx!
-geo


All times are GMT -5. The time now is 05:45 AM.