mdd4696 wrote:Anyways, I've used scorp123's post to partition a drive for a small desktop/server running Ubuntu 6.10 with a 200GB drive (pretty much the system he designed his example for).

Primary (sda1) ext3 128MiB /boot/

Primary (sda2) ext3 4GiB /

Extended 182.18GiB (the rest of the drive)

Logical (sda5) ext3 8GiB /usr/

Logical (sda6) ext3 4GiB /var/

Logical (sda7) ext3 168.18GiB /home/

Logical (sda8) linux-swap 2GiB swap

Can anyone comment on this partition scheme? Does it seem reasonable?

I'm getting ready to install Mint 5 after having just installed Mint 5RC2, and I'm think of partitioning my drive roughly this way, allowing for difference in the size of the drives.

I have two questions: [1] Why is the swap partition at the end? I've heard it should be at the beginning, so it can be accessed more quickly. [2] I have two drives on my machine. How do I mount the second drive? Or do I leave it unmounted?

Usually swap should be at the beginning. There is some logic in the idea that swap should be in the "middle" or at least very close to /usr if that is a seperate partition, but ultimately swap should be either at the start or close to the data you'll be accessing the most so that the drive head is either close to "home" (not to be confused with /home) when accessing swap or doesn't have to move far from the data surge that is causing the swap.

When I partition a system with a seperate /boot, swap is the very next partition in line followed by the root filesystem.

That said, I think that the partition plan detailed above is needlessly complicated for a single-user single-drive home system. I submit that seperating /boot, /var, and /usr on a home system on a modern linux system doesn't offer any real advantages over a single-partition OS install with seperate partitions only for "data" and swap. If you have multiple drives, distributing the filesystem across multiple drives offers some performance advantage but arraying multiple drives in a raid does this even better.

Do you have specific application reasons to actually need seperate partitions for /var and /usr?

There are some security advantages to a seperate /home and it offers some advantages for OS upgrades.

Also, never never never us a journaling file system for a /boot partition, and you don't need it for a / partition either. You have more file system overhead and you needlessly delay your cold boot time with random file system checks. For a single partion install, a journaling file system is good if and only if you routinely churn through different software packages, installing and removing. If you can be trusted to have a stable install, a nonjournaling filesystem for the OS install is acceptable and "lighter".

Why in #2 do I have an Extended partition when none is needed? Subdividing an Extended partition is simpler than playing with Primary partions. If you trust that your partition table will be stable, then use a Primary for this last partition.

The advantage to a seperate /home is keeping your .config files for various software from distro to distro. The disadvantage is the same as the advantage. By partitioning seperately for your user data (typically: video, music, isos, downloads) you make it easy to backup this junk, even easier to backup /home, and you simply create symlinks between the data partition and /home/user for folders that you want directly accessable. This also makes it much much easier to share multimedia or other big file libraries between different users. This also makes it much easier to encrypt, hide, or otherwise make invisible files that you don't want visible.

I suggest layout #2, and further suggest that you configure TWO seperate 12gig "/" partitions. Use one for your primary OS install. Use the other with grub for an alternate OS install, or a "dirty" OS install to field test software packages. It is a very good thing to be able to test drive software in a "safe" environment.

If I read you correctly, this is how I have my system at this time, i.e., prior to the fresh install I' planning, and the way I would have partitioned it in the fresh install if I hadn't come across the suggestions at the beginning of this thread.

As I understand it, you've basically got three usable partitions, sda1/swap, sda2/root, and sda3/sda5/home. I don't understand why sda3 is needed. [Actually, my current install has only sda3/home (the rest of the drive)].

Also unclear about the primary, extended, and logical distinctions and relations among them.

I suggest layout #2, and further suggest that you configure TWO seperate 12gig "/" partitions. Use one for your primary OS install. Use the other with grub for an alternate OS install, or a "dirty" OS install to field test software packages. It is a very good thing to be able to test drive software in a "safe" environment.

Makes sense. However, my machine has only 40 Gb drives. I'm probably going to be getting a new machine soon, and I'll keep this in mind for then. The second 12Gb partition comes immediately after the first?

My last question. I have two 40 Gb drives. I want to use the second for backing up data. It will have only one partition. Any problem with that? And how do I mount it?

Since you mounted both of your 12 Gb partitions as "/," can I mount it as /home? I.e., can I have two /home partitions? [I didn't know how to mount it last time, so I didn't, and as a result I don't have access to it.]

Put the OS on one drive, the swap at the root of the other drive. Why? Because when the drive with binaries is working hard, the other drive will be at rest so a swap based at the root of this idle drive will be accessed quicker than one based anywhere on the busy drive.

Primary/Extended/Logical. Your drive can only have 4 Primary partitions. One Primary partition can be an Extended partition. An Extended partition can have one or many Logical partitions.

/home: as a seperate partition, this makes it easy to keep user .config files seperate. If and when you reinstall the OS, the /home partition can be rolled from one install to the next rather seamlessly. There is a little extra work in this, but usually less than backing up all of the user data in /home and restoring it with a new install. You want enough space for .config data, email, etc, but don't need to allocate /home space for music/video/multimedia/etc. Use one or more seperate partitions for data.

The advice you were following was from someone with experience administering larger unix/linux systems than you're talking about. Multiple drives. Lots of users. Server, not desktop. Different logic and organization applies.

Do you want to be able to have two OS installs on the same machine? I prefer this, because it allows me to have a "stable" day-to-day install that I use routinely, and one or more "experimental" installs. My trio at the moment is Kubuntu-KDE4 with proposed/unsupported, Elyssa stable+proposed, and Daryna-KDE3. Each install has its own /home folder as part of the / partition, but all share media off of a seperate shared partition. For an "alternate" install, a 12gb partition is overkill. Unless you plan to do a lot of development work. But if you just want a place to install a distro to play with it without fragging your main everyday install, 4-6gb is sufficient for all but the most bloated distros. And if your hardware is based around a pair of 40gb drives, you likely don't have the muscle to be playing with big compiz-heavy DVD-based distros. Like Sabayon.

Why? Swap on the secondary drive makes it faster. Small distro partition on secondary drive for testing and for emergency use. The /home is seperated from the primary /, but not the secondary /. This allows plenty of space for user .config files and "stuff". Create symlinks to data on the big storage partitions for ease of access to media files.

Great thread. I'm getting ready to redo my HD and I'm like a few others that have grown beyond my partitions. (Tri boot XP, Mint and Os X) I had separated my / and my /home but because Mint installer stuck my "data" directories on that /home partition, I kept them there. I am currently running no swap on the 2 gB system... So I now want to pull off my 'data' from /home and add a swap. I have run 'swapless' since I installed Daryna and have never had an issue...

Actually, in most cases, almost nothing. Most general purpose desktops with 2 Gig or more RAM rarely need to go into swap. When it does need to go into swap however, it will be noticeably slower. The exception would be if you are running virtual machines. They consume lots of RAM so having a swap partition in that case would be wise.

Having said that, the Linux kernel expects to have a swap partition available. There are some other situations, rare on a GP desktop, that not having a swap partition available can also cause slow downs.

For those looking at a reinstall, you might also want to read the thread below regarding things to consider before installing.

For those looking for a back-up solution you might look at my back-up / restore and clean-up script. It is at version 1.2 now and I am currently testing version 1.3, which will be more flexible and have more options. It should be posted to the below thread replacing version 1.2 in a few more days.

Most of this I understand, some things I don't. [1] 1 Gb /home is enough, even if you separate data from .config files and email? [2] No mount points for the two extended partitions? [3] Symlinks? I've heard of them. Have no idea how to establish them. Sounds more complicated than having data files in /home.

Still don't understand primary/extended/logical. No more than four primary per drive. One primary can be an extended. [Only one? Only one per drive period?] An extended can have many logical. [Logical is a distinction within extended? What's the primary/extended distinction? Primary can't be subdivided?] Why these different types? Why not just one type?

1. The 1gb /home should be more than enough if you don't use it for bulk media storage. Music, Video, etc can all be very bulky. It is bad practice to download direct to the desktop (/home/username/Desktop) and files should be directed to folders as appropriate. The bulk of these would be expected to be directed to folders outside of /home and thus can easily be on a seperate partition.

2. Mount points are at your discretion for the "non-core-filesystem" extra partitions. I mount my internal data/media/junk/download partition as "/Local" but it could just as easily be mounted as "/media/warez" or whatever you want to call it. With two drives, you might have /thing1 and /thing2 or /media/thing1 and /media/thing2 depending on what you prefer. You can edit your fstab (/etc/fstab) as necessary if you have a particular way you want them mounted. If you don't designate mountpoints for those drives, they can still be mounted. They'll show up as /media/hda5 and /media/hdb5.

-sidenote:fstab-If you have multiple swap partitions across multiple drives (internal, external, usb-stick) you can mount them in fstab in a specific order OR you can give one of them an obnoxious priority (bash script or manual terminal). My laptop has a 1.8gb swap partition on the hard disk. This is just part of a polite linux install. The kernel expects to see a swap, so I provide one gratis. But if I am actually expecting to NEED a swapfile, I plug in a usb stick and mount it as a swapfile. Using a usb stick (flash memory) for random access swap is vastly more efficient than a hard drive, so I give it an obnoxious priority (32768) so that if I do need to swap it goes there first.

3. Symlinks are awesome. Open nautilus. R-click a folder. There's the option to create the link. Can't remember if this is Nautilus or just Konquerer (I'm usually a KDE guy so I usually run Konq), but in Konquerer you drag-drop a folder and it asks if you want to move, copy, or create a symlink. Can't get much easier than that. A symlink is a genuine real file system item sitting in a folder that is a pointer to another folder or file of another name and/or location. The name symlink means "symbolic link". Generically, Nautilus creates symlinks in the same directory as the original file with the name "Link to Foldername", and then instead of drag/drop the file you drag/drop the link where you want it. Rename the link. Bobs your uncle.

Here's how I use them:1. In my /Local drive there is a folder called /Music (/media/Local/username/Music). All my music goes there. Its a nice arrangement. If I want access to that music from my desktop, Banshee, an app, anything else, I could direct the entire path name. But I'm lazy and don't like to do that. I also like being able to drag/drop from my home (/home/username) into the music folder. So I deleted the /home/username/Music folder created by default and replaced it with a symlink pointing the way to the real folder on the /Local drive. 2. Video is big and bulky. I don't like to store video (avi files, dvd isos) on my hard disk. I use k9copy to create iso images of dvd video for backup purposes, but an iso image of a commercial dvd is around 8gig. I put these iso files on an external hard drive. I create a symlink in my home folder pointing the way to the actual location on the remote drive, which needs to be mounted at the time the symlink is created but can then be dismounted. When the drive is mounted, the symlink is active.

The other question about primary/extended and the "rules": well, those are the rules. I didn't make them up and they're stupid, but those are the rules for partition tables. Some genius thunk them up decades ago and we're stuck with them. The distinction between Primary and Extended is made in the partition table. The last Primary partition may be created as an Extended partition. An Extended partition is a Primary partition with some special features. Used to be we only had Primary partitions. Now we also have Extended partitions. An Extended partition is a useless designation without a Logical partition within it. Otherwise it is just an empty placeholder. Why is it this way? Because it is.

Okay, P4 & 512mb RAM?You actually should have a swapfile, unless you run a mini-linux (Damn Small, Puppy, etc), and will probably use it. Your CPU can address a max of 4gb ram, but your BIOS might limit that to 3gb. Your swapfile should be a minimum of 1gb, and you could theoretically have up to 3gb of swap but by that time your CPU will be spending so much time swapping that no work will get done. Limit swap on hda to 512mb and add another 1024mb on EITHER hdb OR a usb stick. My preference, given your RAM constraints, would be for you to plug a 1gb usb stick into the back of your computer as a permenant addition and mount it as swap, permenantly. It will be cheaper than doubling your ram (you need oldschool DDR, which will be either pricey and new or cheap and used), and almost as good (better than buying someone's old burnt-out DOA ram anyways). With a usb stick as your priority swapfile and swapping=100 you should be in good shape. But at that point we're bridging into a couple different moderate-skill how-to articles on "usb stick swap" and "swap performance tweaks".

It's a somewhat forgiveable mistake recent converts and ex-Windows users make, but this is definitely not the right way to do this!

Partitioning - UNIX style

Working fullt-time as UNIX + Linux support engineer for a really big company I shall be so arrogant and simply claim that I know what I am talking of.

Putting the entire operating system into one single partition is a big "No" ... It's a mistake ex-Windows users often make because they don't know it better. OK, we shall forgive them. But if you as administrator do this in a live environment with critical applications running on the machines you will get your head whacked off -- either by "friendly" colleagues such as myself or we will make sure the responsible manager will do it. Can you say BOFH?

Basically, if something goes wrong and you have everything in one single partition, repairing this will be very hard.

Having your stuff broken up into the various UNIX-style mount-points has vast advantages here, as any broken partition can be mounted individually and independently from the main " / " root partition.

How I partition my disks (work + private!)

Before exploring this we should take a look what mount-points a typical UNIX and/or Linux system has. And I will sort them here by read/write access likeliness - meaning: Those mount-points which will mostly be read are on the top, followed by mount-points which mostly will get written to:

/boot -- contains the boot loader and boot menu. Is mostly read at boot time, has only limited numbers of write accesses. Because of its importance this should be the first Linux partition on the disk.

/ -- contains all the other filesystems, plus important locations such as /etc, /sbin, /lib, and many other important places that cannot exist on separate partitions. Can have some limited write accesses (e.g. temporary files in /tmp) but for the most of the time only gets read accesses. Because of its importance for the boot process this partition should be right after the /boot partition (otherwise the heads of the disk have to move a lot, especially during the boot process ...)

/usr -- contains all the binaries and the X11 graphical interface (e.g. /usr/X11R6) and libraries that don't belong to the OS proper but rather to an application somewhere somehow (e.g. /usr/lib). Only gets bigger write accesses when applications get installed or someone compiles a kernel (the kernel sources are usually located in /usr/src/linux), other than that this mount-point mostly gets read from not written to. Because of its importance for the boot process and overall significance for the functioning of the system this partition should be right before or right after the " / " partition.

/opt -- some distributions use this for optional stuff, e.g. non-essential tools (from the system's point of view!) such as GoogleEarth and other things that are considered "nice to have" but not really "must have or the system won't work without it". This partition can be anywhere on the disk, but I personally prefer to place it before /var ...

/srv -- some distributions use this to run their WWW and/or FTP servers in there. Sometimes admins chose to create this mount-point as some sort of "sand box" in which they run their network services. Can have some fair amount of write accesses, especially if you have stuff running in there that produces logs.

/var -- used for variable data. Usually your system logs are in there (e.g. /var/log/* ), some distributions use it for the WWW pages that are being served (e.g. /var/www). Gets mostly written to, and then a lot!

/home -- where the users place all their stuff. Bookmarks, config files created by all the various applications and desktops, all one's personal files, and all the stuff you do all day ends up here. Gets read and written to like mad.

So ... given how certain mount-points get written to a lot and others don't, I'd order them the way as written above. Now let's assume you have a 100 GB disk you want to partition, and you will use your system for WWW (e.g. to host your personal homepage on it + a small forum?) and maybe for some FTP (e.g. to exchange files easily with other users?), here is the partitioning I would suggest:

/dev/hda1: /boot, 50 MB min., 150 MB max./dev/hda2: /, 2 GB min./dev/hda3: extended partition, up and until the end of the disk/dev/hda5: /usr, at least 5 GB/dev/hda6: /opt ... if you want it. 2 GB should be enough/dev/hda7: /srv ... if you really want it. At least 4 GB/dev/hda8: /var ... at least 2 GB./dev/hda10: /home ... at least 75-80 GB if we take a 100 GB disk as basis/dev/hda11: swap ... 2x the size of your RAM, but not more. If you have like 2 GB RAM, then 1x the size of your RAM should be enough.

Now, the beauty in this setup is that first of all it's properly partitioned and less likely to give you headaches, and the second aspect is that all the partitions with lots of read accesses are concentrated towards the beginning of the harddisk and thus can be read faster whereas the partitions which will get lots of write accesses and which are more likely to fragment a little are towards the end of the harddisk (towards the physical center as stated by someone else further down in this thread).

This is how it's supposed to be done.

Suggestions and flame messages welcome

EDIT: some factual errors about where harddisks begin or end corrected ... Thanks to all

this is exactly where alot of my problems stem from now i am running mint 5 Elyssa main editionu think you could break down that partion table in bytes so i i know what to type in or tell me how to break that down

A Windows user will not endear himself by bringing his habitual attitudes over to Linux, to put it lightly....The Newbie with His Foot in His Mouth

Also, 1GB = 1024MB.If your using GParted, it asks you to set partition sizes in MB. If, for aesthetic reasons, you want your partitions to be even GB numbers, just take what you want in GB * 1024 to get the number to punch into GParted.

ex: 5GB * 1024 = 5120 MB; 60GB * 1024 = 61440 MB.

Speaking of GParted, the GParted Live CD is awesome. http://gparted.sourceforge.net/livecd.php(as far as this newbie can tell, you can't edit partitions while they're mounted, so you can't modify your Mint / partition from inside of Mint - this is where the GParted CD comes in). I suppose you could use the Mint Live CD too, but it takes longer to boot and such.

One tangent: do be aware that with the GParted Live CD, you're running with root permissions. So don't open a terminal and start typing commands if you don't know what you're doing (last night for instance, I accidentally ran chmod on every file in my Mint 5 partition, which really hosed things. Thankfully, I'd used GParted to back that partition up 2 hours earlier, so I just restored the partition back. But that could have been very, very bad.)

Once I partition my hd in / and /home, what should I do before installing a new system? Should I wipe out everything on my home folder but my own stuff (cleaning all the hidden paths), or having those directories will somehow help my new system to read my configs?

You should tell us what your goal is. For example:What are your trying to accomplish? Are moving from one Mint version to another, or from Ubuntu (or an unbuntu based system) to another unbuntu based system. Do you want all the same packages installed? What do you want to do if the new install fails - reload a backup of the current OS?

I'm currently moving back from pclinuxos to mint 6 (hopefully to mint 6 KDE the moment the final version is released). I don't need all my configurations to be kept, because I only tested that distro for about two weeks. What I'd like to know is:

When I [re]install mint and set this data partition mountpoint to /home/vinicius, the new system will automatically recreate the needed system folders (in the case I delete them), as well as keep intact my Pictures, Movies, Documents, etc folders, or will it overwrite their content?

My hd is partiotioned in three: a filesystem "/"; a swap space; and a data partition "sda" mounted on /home/vinicius/

If your data partition is truly not on the same partition as root or home then your data should be safe. There are some good how to posts, the wiki also has a good section on partitioning and install. And don't forget the users guide (theres a link on the Linuxmint.com/start page). Referencing that guide look at page 18. Note the format column has a check box - don't check it on that data partition.