LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 02-16-2004, 09:37 AM   #1
Ragnaar
LQ Newbie
 
Registered: Feb 2004
Location: England
Distribution: Madrake 9.2
Posts: 6

Rep: Reputation: 0
Question How to remove windows partition and incorporate the free space into linux?


Basically as the subject suggests -

On my machine I have Mandrake 9.2 on a small partition (i was just testing it to see if it was better than windows!) and the rest is taken up by windows.

I would like to wipe windows off the other partition and somehow amalgamate the resulting free space into the current linux partition - is this possible or would I need to totally start from scratch?

Also bearing in mind I have no swap partition - I would need to set one up

Any help/advice would be great
 
Old 02-16-2004, 09:55 AM   #2
tangle
Senior Member
 
Registered: Apr 2002
Location: Smithville, TN
Distribution: Slackware
Posts: 1,744

Rep: Reputation: 70
Yes it is possible to do it. Can you give your partition info? It will make it easier to give a step by step guide.
 
Old 02-16-2004, 10:33 AM   #3
Ragnaar
LQ Newbie
 
Registered: Feb 2004
Location: England
Distribution: Madrake 9.2
Posts: 6

Original Poster
Rep: Reputation: 0
Okay, I've got :

/mnt/windows on hda1 (ntfs) size is 29G

/ is hda5 (linux native) size is 8.9 G

that's info from DiskDrake
 
Old 02-16-2004, 11:22 AM   #4
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 451

Rep: Reputation: 32
http://doc.mandrakelinux.com/Mandrak...diskdrake.html

gives an example of usage to shrink partitions. In your case, one would unmount and delete the ntfs partition and create swap, /var2, /home2 or whatever in the blank space. Format ONLY those new partitions. Then you can reboot and copy files, edit /etc/fstab, edit /etc/lilo.conf as necessary.

As always, before surgery, backup any data on any partition you wish to preserve in case of a mistake. Things like /etc and /home come to mind...

PS You should use journalled filesystem for better reliability.

Last edited by RobertP; 02-16-2004 at 11:25 AM.
 
Old 02-17-2004, 04:32 AM   #5
Ragnaar
LQ Newbie
 
Registered: Feb 2004
Location: England
Distribution: Madrake 9.2
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for the reply. I'm fairly clear on how to use that to delete the NT partition, but I have a few questions.. (sorry if there are obvious answers to these!)

Firstly, how big should the swap partition be? 500Mb? 1Gb?

How would it be possible for me to retain only the operating system stuff on the current partition (9Gb), and move stuff like the /home directory to the new partition - would linux recognise that users home directories had moved to a new partition? Or would I have to specify that somewhere?
Also, if I wanted to install new software, programs etc, would installing them to the new partition be a reasonable course of action - for example if i ran out of space on the 9Gb partition?

Many thanks in advance!
 
Old 02-17-2004, 07:44 AM   #6
tangle
Senior Member
 
Registered: Apr 2002
Location: Smithville, TN
Distribution: Slackware
Posts: 1,744

Rep: Reputation: 70
You should need no more than a 512mb swap partition (256mb should be fine).

Once you create you new partitions you'll need to use the dd command to move all you data to you new partition (or you could use tar).

Don't forget to make a boot disk for you old Linux partition. If you mess up your boot loader or /etc/fstab files you can boot to your old partition to fix it.
 
Old 02-17-2004, 04:29 PM   #7
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 451

Rep: Reputation: 32
Quote:
Originally posted by Ragnaar
...
How would it be possible for me to retain only the operating system stuff on the current partition (9Gb), and move stuff like the /home directory to the new partition - would linux recognise that users home directories had moved to a new partition? Or would I have to specify that somewhere?
Also, if I wanted to install new software, programs etc, would installing them to the new partition be a reasonable course of action - for example if i ran out of space on the 9Gb partition?
...
That's what I like! Concise, precise questions are easily answered with the appropriate commands:
Suppose your new partition is /dev/hda2 (substitute for the appropriate device and partition)
As root
#telinit 1 (useful when doing brain surgery in case other processes are doing stuff)
#mke2fs -j /dev/hda2 (will make a journalling filesystem on the new space. Skip if already there)
#mkdir /newhome (make a temporary connection between the new partition and the old fs)
#mount /dev/hda2 /newhome
cd /home
cp * /newhome
When you are satisfied that the files in /newhome are OK edit the line in /etc/fstab refferring to /home to mount /dev/hda2. If there is no such line, add
/dev/hda2 /home ext3 defaults 1 2
Then
#cd /
#umount /newhome
#mount /dev/hda2 /home
#rmdir /newhome
This leaves your original /home stuff still on the drive. If you wish to delete it, put

#rm -fr /home/*

just before the line #mount /dev/hda2 /home
#telinit 3 or 5 or whatever your usual run level is. Next time you reboot, /home should mount

Most user software is installed in /usr. If you have space, you could create a partition for a larger /usr and do the above. Another possibility is to mount a new partition on /usr/local
I hope this helps. Brain surgery is very scary. You can kill the patient with a little mis-typing.
 
Old 02-17-2004, 06:57 PM   #8
ArmedGeek
Member
 
Registered: Jul 2003
Location: Houston Texas
Distribution: Mandrake
Posts: 38

Rep: Reputation: 15
On the swap partition question...

All my Mandrake boxes are running 512MB ram (even the server) with a 512MB swap partition and to be honest, I've never seen the swap partition used AT ALL. Now, I'm not saying that you should not set up a swap partition, but from some folks I've heard the number 1.5x your amount of RAM. I can't see that ever being necessary.

Point is, you don't need to get nuts with your swap partition.

--ArmedGeek
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can linux be installed on Windows partition's free space without repartitioning? khurdp Linux - Distributions 1 02-08-2005 11:51 AM
partition used/free space elbriga Linux - General 2 09-24-2004 12:36 PM
I want to increase my Linux partition.Should I take space from a Windows partition? PrinceBalak Linux - General 1 06-25-2004 05:44 PM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
is windows extended partion free space visible to linux fdisk purplesky Linux - General 1 11-12-2002 07:27 PM


All times are GMT -5. The time now is 04:44 AM.

Main Menu
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