Multiple Partitions


Forum: HD Install
Topic: Multiple Partitions
started by: Chaos750

Posted by Chaos750 on Nov. 14 2004,21:39
Right now I've got DSL all running off of 1 small partition.  After reading all the HowTo's saying you should use multiple partitions, I was planning to set it up like this:

hda1: Windows (1gb)
hda2: / (300 mb)
hda3: Swap (50 mb)
hda...: whatever (~740 mb)

So like I said, everything is in hda2, and I'm almost out of space, obviously.  My first question is what type of setup would you reccomend, and more importantly, how would I go about doing it?  Do you just make the partitions and then copy over the directory you want? ie if I wanted /usr in a separate partition, would I just copy everything in /usr over and then delete the originals?  I hope this makes sense, I'm new at this.

Thanks in advance for any replys.

Posted by AwPhuch on Nov. 15 2004,03:06
Quote (Chaos750 @ Nov. 14 2004,16:39)
Right now I've got DSL all running off of 1 small partition.  After reading all the HowTo's saying you should use multiple partitions, I was planning to set it up like this:

hda1: Windows (1gb)
hda2: / (300 mb)
hda3: Swap (50 mb)
hda...: whatever (~740 mb)

So like I said, everything is in hda2, and I'm almost out of space, obviously.  My first question is what type of setup would you reccomend, and more importantly, how would I go about doing it?  Do you just make the partitions and then copy over the directory you want? ie if I wanted /usr in a separate partition, would I just copy everything in /usr over and then delete the originals?  I hope this makes sense, I'm new at this.

Thanks in advance for any replys.

I would recommend getting a "LiveCD" utility distro called < Ultimate Boot CD >
Using its partition utility build the partitions how you want and then use the installer to build on the drive, its alot easier than trying to do it manually using the cfdisk or fdisk to do

Brian
AwPhuch

Posted by Nmeumonic on Nov. 15 2004,05:07
I have a similar problem.  I installed DSL on a 4 gig drive and partioned off 300mb for it.  I then got the idea of making another 2gig partion to save my music on, then make the rest of the drive for misc. stuff.  When I went to partition the drive, it said it partitioned it, but the partition table couldn't be read.  I made it a linux partition, if you thought that was the problem.  I rebooted, tried to mount and/or save data to it, this is what I got:
Tried to mount; Device is busy, not responding, etc...
Tried to save;   Device couldn't be found in (some directory or log, I forget.)  Sorry if that last one is vague, I'm at work at the moment, and don't know the exact error message.
I was just hoping someone else has experianced this, knows how to fix it, and is willing to share.

Posted by Ninja-school on Nov. 15 2004,09:48
If you have partitioned your hard drive too many times you break it,
I did this with an old hd, but it fixed itself after a while.
Once you have made a partition table try not to change it.

Posted by skaos on Nov. 15 2004,11:17
Nmeumonic: If you don't mind wiping the whole disk (including partition table), you could use Darik's Boot and Nuke, < http://dban.sourceforge.net/. > Wipe the whole disk, not the partitions - this should fix the problem with the partitions.
Posted by AwPhuch on Nov. 15 2004,19:53
This is very very true...
I have made an automatic version of dban, it can be found < HERE >  just read the README before putting the floppy in your drive.

The nice thing about this is it "factory defaults" your harddrive, no MBR, no paritions, no data...fresh "zeroed" drive

Brian
AwPhuch

Posted by Chaos750 on Nov. 15 2004,21:36
Hmmm, i'm not sure if I stated my problem clearly...

I have the hard drive partitioned the way I want it.  That's not the problem.  I would like to know how I should move my files onto the new partitions?  For example: I want to move /usr off of my root partition because it is really huge.  The partition is all set up.  What should I do next?

Sorry if I was confusing or misleading before.

Posted by AwPhuch on Nov. 15 2004,22:46
you have to format that partition ext2, label the partition your /usr partition then cp all files from the current /usr to the new /usr and unmount the old /usr. remount new /usr, and then modify the /etc/fstab file

< http://www.linuxquestions.org/questions/archive/2/2001/07/3/4372 >
< http://www-106.ibm.com/developerworks/library/l-partplan.html >

Google is your friend!!

Good luck

Brian
AwPhuch

Posted by newOldUser on Nov. 16 2004,00:40
Sometimes after you setup a partition and move your files it's hard to tell if you did it right. Here's one way to tell...

Start up Midnight Commander (MC).  Set the left panel for "listing mode" and the right panel for "info" While you have a file or directory highlighted in the left panel you will see information about it in the right panel. Part of that information is "Device:"  That tells you where the file is located. After you copy your files, change fstabs and reboot, your Device: information should be the new partition you moved them to.  

Just my 2 cents... good luck.

PS... The other way to tell if it's working.... Your system not booting is usually a bad sign

Posted by Chaos750 on Nov. 16 2004,02:20
Okay, thanks very much.  Those sites were very helpful.  AwPhuch, I've been Googling all afternoon =)  I've actually got a new problem now, though.  I've been moving folders onto new partitions, and changing /etc/fstab accordingly.  The problem is that even though I've set the options to "defaults" they aren't mounted at startup.  Doing a "mount -a" mounts them, but I thought this was supposed to be done automatically at boot with default options, since the default is auto.  I don't have it in front of me, but I believe the entries were like this:

/dev/hda5  /home  ext2  defaults  0  0

Posted by cbagger01 on Nov. 16 2004,04:41
DSL will reconstruct your /etc/fstab and rebuild it automatically on every reboot.

If you wish to create a permanent fstab, you will need to either remove the part inside the startup scripts where it rebuilds the fstab, OR you can add manual mount commands to your /opt/bootlocal.sh and mount your filesystems.

Just make sure to specify the correct mountpoints in your commands, IE: /dev/hda5 = /usr  for example.

Posted by Chaos750 on Nov. 16 2004,23:46
Really?  It seems like fstab is the same even after I reboot.  Is the system rebuilding it and then replacing it with the one on disk?  And like I said, executing mount -a mounts all the partitions I wanted mounted before.  So far, right now I've got /home and /var on separate partitions, and now card manager freaks out a little bit because /var isn't mounted yet.  There's no serious problems, as I can just mount after I login and everything works fine.  And bootlocal.sh seems to be the last thing that the system does before bringing me to the login screen.  The problem is, I was hoping to move /usr to a separate partition as well, and I don't want to do this if the system expects it to be there at boot.  It seems like some of the stuff in there is important =)
Posted by Ublis on Nov. 21 2004,17:28
The /opt/bootlocal.sh method worked for me when moving /home to a different partition. Changing /etc/fstab directly didn't work, which really puzzled me until I read cbagger01's reaction.
Posted by Chaos750 on Nov. 21 2004,22:11
Yeah, bootlocal.sh works for me too -- at least for /home.  I was hoping there was a way to mount before that point.  Or maybe that isn't neccesary?  I don't know what is neccesary to start up.  If I could get away without, say, /var or /usr until just before login, that would work... Problem is, I don't think that's the case.  As I said, those files look too important to only be neccesary to start X.  

Would it work to just put a line into one of the startup scripts, like "mount -a"?

Maybe I'll just take the plunge, see what happens.  That's what emergency disks are for, right?  And there's always my Windows partition =P

Posted by sweavo on Dec. 01 2004,12:47
Quote (Chaos750 @ Nov. 16 2004,18:46)
Really?  It seems like fstab is the same even after I reboot.  Is the system rebuilding it and then replacing it with the one on disk?

Hi all.  I'm in the middle of this at the moment.  I have the following:

swap
/
/usr
/home (cos then I can keep/move my user data easily or trash it and mount home from another machine
/var (cos I've had problems with logs filling up before, so they can fill up their own partition and leave some space for root to play in

My version of knoppix-autoconf (don't know what version of DSL I'm running.  thought it was 5 - maybe it's 0.5) does detect partitions but it adds them into fstab, so manual changes to fstab survive.  An exception is the usb drive detection, which adds itself to fstab whether or not it already exists... a stupid bug which should never have made it into the script...

I did something like the following (note: not checked any syntax, just illustrating the approach I used)

# fdisk /dev/hda
[ set up partitions, leaving alone the current / partition ]
# mkfs /dev/hda2
...
# mkfs /dev/hda4
# reboot
# cp -r /home /mnt/hda2
...
# cp -r /var /mnt/hda4
# vi /etc/fstab
[ set up new mountpoints ]
# mv /home /home.orig
...
# mv /var /var.orig
# reboot

One problem I had was that knoppix-autoconf uses stuff in /usr before mounting the fsystems so I had to copy a few files from /usr/bin to /bin.

I'm in the middle of hacking knoppix-autoconf to pieces, as I believe a lot of it should only be run once, on the first boot after installing to HD.

Hope there's some help there.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.