Click to See Complete Forum and Search --> : Partitioning for Linux and FreeBSD


thully
01-12-2001, 01:28 PM
Hello,

I have 5GB free space on a 13GB HD (and an old 4GB hard drive), in which I want to place Linux and a test partition (where I can run FreeBSD/another distribution). I want a good partitioning scheme, but I don't want anything too complicated. Any suggestions? I want something that will work better than just root and swap. Should I use this old HD at all, since it is slower than my 13GB UDMA hard drive.

manual_overide
01-12-2001, 01:50 PM
Definitely use that old HD. you cant have too much space. Plus, if you want linux and a test bed for BSD or whatever, you'll have better results if you have more than 5 gig.

I'm assuming the other 8GB on the drive is for windows. If you are willing to blow everything away on that drive, you'll get a better partitioning scheme, but if not that's OK too. I suggest having at least a /home in addition to the / and swap partitions, just so you can keep all of your settings and files if you need to reinstall linux. Make any others that you want. Dedicate the second drive to BSD or whatever.

thully
01-12-2001, 02:47 PM
Right now my partitions look like this:
5GB (Windows Me FAT32)
3GB (Windows NT NTFS)
5GB (Free space)

What would be a good size for / , /home, and swap? I'm not going to wipe Windows since I have a few games/apps that I use a lot that are unavailable for Linux, and Win4Lin/VMWare won't cut it for me, since they are expensive and I have an NT partition also.

Linuxman
01-12-2001, 03:01 PM
personally, i think just using "/" and "swap" is the best scheme if you are testing things out. However, I've got my COL 2.4 setup as follows (sizes are rounded):
hda1 / 133 MB
hda9 swap 256 MB
hda10 /var 959 MB
hda 11 /home 2300 MB
hda12 /usr 1900 MB
hda13 /opt 1500 MB
hda14 /usr/local 1400 MB

You must remember and be warned that older version of LILO freak out if "/" extends beyond cylender 1024. So get that issue resolved first. Also, I copied a thread several months ago concerning this very issue with everyone having their own suggestions. Here it is:

Here's what I'd recommend:
THE SIMPLE WIMPY WAY
hda1 - 6144MB (6GB) - ext2 - Linux /
hda2 - 2560MB (2.5GB) - fat32 - Windows C:
hda3 - 512MB (0.5GB) - swap - SWAP
THE BUFFED-UP MANLY WAY
hda1 - 256MB - ext2 - Linux /
hda2 - 1024MB - fat32 - Windows C: (system files only)
hda3 - * - EXTENDED
hda5 - 2048MB - fat32 - Windows D: (apps and data, or split them into two partitions as desired)
hda6 - 376MB - ext2 - Linux /var
hda7 - 2000MB - ext2 - Linux /usr
hda8 - 3000MB - ext2 - Linux /home
hda9 - 512MB - swap - SWAP
Now, this is just a suggestion... adjust to your tastes.
Some people will tell you that you'll probably never need 512MB swap. They're right, but the keyword is PROBABLY. If you think space is going to be a premium, then only do 256MB of swap, but NO LESS THAN THAT.
How's that look?


_________________________________________________

i'll take a stab at making a suggestion, but craig or somebody else may make you a better offer.
mandrake's disk partitioner is really easy to use, so i'd install mandrake first. my first partition would be ~2 GB dos, followed by linux "/" of 512 MB or so, then about 6.5 GB dos, 250 MB (or so) "swap" and the rest whatever linux partitions you like (probably at least 2 GB for "/usr"). be sure to create the boot floppy!
then you can boot with a dos/win floppy and format the first dos partition, then install windows, then boot windows and format the other dos partition, then boot linux with the linux boot floppy and run lilo from a console.
you may be able to make "/" the very first partition but i simply haven't tried that and don't know.
oh yeah, if you don't want to use lilo, there's a NHF on using loadlin, also something called chos is available but i haven't looked into it yet..........roy
[This message has been edited by RoySmith (edited 15 March 2000).]


___________________________________________

Y'know what, that's the weirdest thing I've ever heard of happening to a system other than mine.
I'm not sure what dual-boot document you're talking about, but here's a crash course:
0. Boot from Linux boot/root disks.
1. Repartition drive. Make the boot partitions for the OS's (the / filesystem for Linux, the C: drive for Windows) the first two partitions on the drive, preferably Linux first. Make sure the Linux partitions BEGINS and ENDS below the 1024th cylinder (usually about the 8th GB) and make sure the Windows partition BEGINS under the 8th GB.
This is how I'd recommend starting the partitioning:
/dev/hda1 : Linux ext2 : 128MB
/dev/hda2 : DOS FAT : 1GB
I like to install JUST Windows system stuff to the C: drive, which will take less than a GB, and then install applications and put the swap file on another drive. Do whatever suits you, but putting a small Linux partition at the beginning of the drive to install Linux on, as shown above, is highly recommended.
2. Inside an extended partition, create all the Windows, Linux, and Linux swap partitions you'll need. At least 128MB of swap, 256MB if you want to be safe. Make Linux partitions for /usr, /home, and /var. At least 1 GB for /usr. Pref. >200MB for /var.
3. Install Linux. Specify mount points for your /home, /usr, and /var partitions. INSTALL LILO TO THE LINUX ROOT PARTITION, NOT TO THE MBR.
4. Linux is running. Now, boot from a DOS bootdisk.
5. IF YOU HAVE MORE THAN 4 LOGICAL PARTITIONS INSIDE YOUR EXTENDED PARTITION, DO NOT USE DOS'S FDISK TO EVEN LOOK AT THE DRIVE, OR IT WILL DESTROY THE PARTITIONS.
6. Install Windows.
7. Use fdisk to set the Linux root partition to be the active partition.
Any questions?


_______________________

Tired of all the troubles I had with my Linux installation due to my poor partition planning, I wiped my entire HD yesterday in a frenzy of loud music and alcohol.
Here's the specs :
13 GB HD on a Pentium III 450MHZ
128 MB RAM
Dual boot Win98 - Linux
I want to keep a 98 FAT32 partition for UnrealTournament (I'm a moron - I can't get my 3Dfx to work under Linux), and for a couple other games. The remaining space is dedicated to Linux. I'd also need an "archives" partition, so I can store those bulky RPMs and other files/apps I want to keep safe (I'll eventually get a CD burner or tape drive). My Linux box will be a home desktop, no inbound connections/services. I am not running any excessively huge applications.
This is what I have so far :
LILO
In the MBR
Primary Partition
Win98 (FAT32) : 2.5GB
Extended Partition
Remaining space (about 10.5GB)
Logical Partitions
/ (Ext2) : 1.05GB (10% of space)
/home (Ext2) : 2.1GB (20% of space)
/archive (FAT16) 3GB (Win98 & linux stuff)
/usr (Ext2) : 4GB (remainder of space)
/SWAP 256MB (2x amount of RAM)
I do not mount /var in a partition of its own since I will not run any service daemons (telnet, ftp, ssh, etc.) and therefore do not expect an overwhelming amount of log files. There will be only 2 users on this box, and a normal amount of mail.

I'd like your opinion(s) on this scheme. Does it sound right? Is that what you'd do? Am I bound for the asylum?
Many thanks!

Hmm, I see some problems. First, though LILO should be able to boot from a logical partition, it's kinda kludgy to have your / inside an extended partition. Notice how you'll be having more than 4 logical partitions inside your extended? Windows does NOT like that. If you or anybody else on your system happened to ever use DOS's fdisk to even LOOK at that extended partition, the all of those partitions would be GONE instantly, all your Linux stuff eaten by the MS-Monster. Needless to say, that's dangerous.
Why not do this?
I won't start from scratch, I'll just amend.
LILO
On the Linux / partition (never install LILO to the MBR unless you're installing Linux on a second hard drive or have some other reason), with that partition marked active.
Primary Partition hda1
Win98 (FAT32) : 2.5GB
Primary Partition hda2
/ (Ext2) : 1.05GB
Extended Partition
Remaining space (about 9.45GB)
Logical Partitions

/home (Ext2) : 2.1GB (20% of space)
/archive (FAT32*) 3GB (Win98 & linux stuff)
/usr (Ext2) : 4GB (remainder of space)
SWAP 256MB (2x amount of RAM)
*FAT16 drives can only be up to 2.1GB, and at that large size they're woefully inefficient. Don't worry, the days of Linux having trouble with FAT32 drives ended a couple years ago.
Another problem with your initial setup is that with five logical partitions inside that extended, Windows would not be able to see, access, or otherwise acknowledge the FAT partition inside there, which would defeat the whole purpose of it.
And though it's good you're using 256MB of swap space, that "2x amount of RAM" rule is complete bull. The amount of RAM you have does not determine how much swap you'll need, want, or use; what you DO with the system determines that. And 128MB RAM & 256MB swap will give you a LOT of flexibility.
Just make sure you're not using a dirt-old distro that doesn't have total support for swaps larger than 128MB. Almost all latest releases of distros use a kernel that can handle larger swaps, but some of the disk utilities included with them might be older versions. For example, if the distro includes an older version of mkswap, it might refuse to format more than 128MB of the swap partition. That's no big deal, 128MB is much more than enough to last you long enough to download a new version of mkswap and stuff. You could use two 128MB swap partitions for backward compatibility, but then you'd again have five swap partitions inside your extended, again making the FAT drive in there inaccessible to Windows.
How's that?
One last nit, sorry, this is just a pet peeve of mine, I hate when people say "/SWAP" like it's a mount point. It's not. There's no such thing as /SWAP or /swap or anything like that. The mount point for swap space is "none". There's no harm in doing something like this, it's just as easy to understand, and more correct:
hda5 /usr
hda6 /home
hda7 /var
hda8 swap
Best of luck, and happy partitioning!


________________________________________________

Assuming this will be your primary drive
I have a 17GB and a 2GB and mine is something like this:
/boot - essential, about 10-20MB, make it your first partition, completely below 1024 cylinders
[Windows 98 etc] On mine this is 8GB, 50% of the drive
/usr - 2GB
/var - 100MB
/home - 1GB
/games - 2GB
/tmp - 250MB
swap - 128MB
/ - 1GB
/usr/local - 500MB
/usr/local/src - 500MB
/opt - 1GB (I have no idea why though, nothing in it)

I did that using disk druid, it will arrange all the partitions making best use on each drive - it's a great tool.

___________________________________________

Your partition table is gunna be a mess, you realize that, right?
But it's not a problem to do. I just wonder why you'd want to install so many OS's that do the same thing on the same machine.
Just make sure each OS's root partition is under the 1024th cylinder, probably around 8GB. I assume you have Redhat installed on a primary partition... good. Install LILO to that primary partition rather than to the MBR, and don't let any of the other distros install boot loaders when you install them. Have a DOS boot disk on hand just in case anyone writes to the MBR without permission.
I personally would recommend, in your case, having one big extended partition in addition to your primary Redhat partition. Put a 128MB - 256MB partition at the start of that extended partition for each of the other Linuxes you want to install, then a 1GB or so partition to use as your BSD disklabel (FYI: the BSD OS's use one partition, called a disklabel, partition type a5, which serves as a kind of extended partition in and of itself, although it's really not -- well, you can read about that in the BSD stuff). So, we have something like this so far:
/dev/hda1 - 2GB - Linux native #Redhat
/dev/hda2 - rest of drive - Extended
/dev/hda5 - 128MB - Linux native #Slackware /
/dev/hda6 - 128MB - Linux native #Debian /
/dev/hda7 - 128MB - Linux native #Mandrake /
/dev/hda8 - 128MB - BSD/386 #BSD Disklabel
Now, create your swap partition(s). All the Linuxen can share the same swap partition(s). Now, create /home's, /usr's, and /var's for all of those distros... I told you this was going to be messy! Don't try to share those between distros... it'll be nothing but headaches.
Now, install each of the distros, being VERY careful about the mount points you specify, and making sure nothing tries to destroy your beautiful (cough) partition table. Make sure nothing installs any kind of boot loader.
Once that's all done, boot back into Redhat, edit your lilo.conf into the longest lilo.conf ever used in the history of Linux, run lilo again, and you're done.

_________________________________________

BOOT LOADER: LILO is the de-facto standard, however a LILO clone + extensions + cool stuff, known as CHOS, gets my award. The configuration and installation is about the same as LILO, but the configuration file is a lot cleaner and there are a lot more options. It uses a cool menu rather than an ugly boot: prompt.
1. One gig is plenty, but you might want to edit /etc/logrotate.conf and edit it to keep only two weeks of logs rather than whatever the default is. Also, edit /etc/syslog.conf and turn off some of the logging that you don't need. Assuming you allow 300MB for logs, temporary files, and incidentals, that's 700MB... you can fit a LOT of packages into 700MB, just be sure to select packages yourself so you get exactly what you want.
2. You can install LILO during the Linux installation, you can go ahead and do that if you want, but I prefer to make a boot floppy instead and boot from it so I can edit the lilo.conf and get it EXACTLY as I want it before I install LILO. THen, as soon as possible, I download CHOS and replace LILO with it.
3. You don't HAVE to, you can use swap files instead, but it's slower and more dangerous.
Good luck!

___________________________________________

Here is a slick way to use Windows 95/98 to multi-boot another operating system!
1. Download and install "Loadlin" in C:\Loadlin directory in Windows.
2. In the Loadlin directory, modify the linux.bat file to "point" to the drive and partition that contains your Linux installation.
ie: If you have Linux on the second partition on your 'D' drive, you could use:
loadlin c:\vmlinuz root=/dev/hdb2 ro
ie: If you have Linux on a UMSDOS directory on your 'C' drive, you could use:
loadlin c:\vmlinuz root=/dev/hda1 rw

3. Copy your compressed kernel (i.e.: vmlinuz) to C:\ on your Windows partition.
4. Edit your C:\msdos.sys file to change the following values to zeros:
[Options]
BootGUI=0
BootDelay=0
BootMenu=0
Logo=0

5. Replace the contents of C:\config.sys file with the following:
[Menu]
menuitem=Win95, start Windows 95... (or Win98, start Windows 98...)
menuitem=dos, start MS-DOS...
menuitem=Linux, start Linux...
menudefault=Win95,5 (or Win98,5)

[Win95] (or [Win98])
DEVICE=WINDOWS\HIMEM.SYS
DEVICE=WINDOWS\EMM386.EXE NOEMS
DOS=HIGH,UMB
[dos]
DEVICE=WINDOWS\HIMEM.SYS
DEVICE=WINDOWS\EMM386.EXE NOEMS
DOS=HIGH,UMB
[Linux]

6.Add the following to the BOTTOM of your C:\autoexec.bat file:
goto %config%
:Win95 (or :Win98)
win
goto end
:dos
goto end
:Linux
cd loadlin
linux
:end

7. When you boot up your computer, you will be presented with a "Start Up" menu
with 3 choices:

Start Windows 95 (or Windows 98)
Start MS-Dos
Start Linux
8. If you do NOTHING, Windows will auto-boot in 5 seconds. If you want to boot Dos or Linux, you must select one within the 5 seconds.
9. Loadlin will let you pass commands to the kernel, if necessary. (just like Lilo)

Making your Boot Floppy
A. Place a blank 1.44 Mb. floppy into your A Drive.
B. Using the Dos Prompt, type: format a: /s and then press enter.
C. Copy loadlin.exe from the C:\loadlin directory onto the floppy.
D. Copy your vmlinuz file from C:\ onto the floppy.
E. Create an autoexec.bat file on the floppy with the following lines:
@ECHO OFF
rem
rem Loadlin <kernel_image> root=<root device> ro|rw
rem
rem Other information may need to be passed to the kernel through Loadlin.
rem See llmanual.txt included with Loadlin for more information.
rem
LOADLIN a:\vmlinuz root=/dev/hda1 ro (the hda1 is an example only: see below)
(following the examples from step 2 above, use hda, hdb, hdc, or hdd to
denote your drive and partition number where your linux is installed)

When you use Loadlin as your boot manager, you will ALWAYS skip any steps that
refer to the use of Lilo.
I like this much better than Lilo because it DOES NOT ALTER THE WINDOWS MBR !
NEVER again will you see that annoying "Li" without the "lo" !!!!!
Following the above example of the autoexec.bat and config.sys files, you can also
add selections for even more operating systems such as OS/2 or BSD, etc.
There is no limit to the number of systems that you can boot with this method.
(better buy lots of hard drives

)
[This message has been edited by Eclipse (edited 05 December 1999).]

------------------
ADOPTION not abortion. Proud father of an adopted boy.


NFL Playoffs Week 2
Ravens 24, Titans 10
Regular Season
W 12
L 4
Playoffs
W 2
L 0
Next Week, at Oakland.

One more and we're in.

[This message has been edited by Linuxman (edited 12 January 2001).]