LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-09-2005, 01:32 PM   #1
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Rep: Reputation: 30
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
 
Old 02-09-2005, 04:00 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
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.
 
Old 02-09-2005, 06:30 PM   #3
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
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
 
Old 02-09-2005, 09:39 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,483

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
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.
 
Old 02-09-2005, 10:50 PM   #5
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
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
 
Old 02-09-2005, 11:49 PM   #6
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
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...
 
Old 02-10-2005, 12:48 AM   #7
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
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 ).

Cheers,
geomatt
 
Old 02-10-2005, 02:24 AM   #8
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
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...
 
Old 02-10-2005, 07:55 AM   #9
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
OK, I'll try something like that and will post any problems I have.

Thanks for the help!

-geo
 
Old 02-11-2005, 06:39 PM   #10
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
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
 
Old 02-11-2005, 07:59 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,483

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
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.
 
Old 02-12-2005, 09:28 AM   #12
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
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
 
Old 02-12-2005, 05:37 PM   #13
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
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
 
Old 02-12-2005, 07:22 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,483

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
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.
 
Old 02-13-2005, 09:49 AM   #15
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Original Poster
Rep: Reputation: 30
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 - 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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
expanding root partition... DaVenom Linux - General 4 09-11-2005 02:19 AM
Expanding an NTFS partition nonoitall Linux - Newbie 3 05-20-2005 04:58 PM
Wiping my Win2K partition? Ice9 Linux - General 5 04-17-2003 05:54 PM
Expanding a partition echid Linux - General 1 08-12-2002 11:21 AM
need help expanding a partition linuxmaster Linux - General 2 12-01-2001 04:25 PM


All times are GMT -5. The time now is 10:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration