How To: Partition your Hard Drive.

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
User avatar
AK Dave
Level 6
Level 6
Posts: 1042
Joined: Wed May 14, 2008 3:39 pm
Location: Anchorage, AK USA

Re: How To: Partition your Hard Drive.

Post by AK Dave »

Two drives? 40gb each?

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.

Here's my table:
sda
Primary (sda1) swap swap 1.8gb
Primary (sda2) ext3 / 12gb
Primary (sda3) ext3 / 12gb
Extended
Logical (sda5) ext3 / 12gb
Logical (sda6) ext3) - remainder

2 drives? 40gb each? How much RAM do you have? What sort of processor do you run? I'll make some assumptions: 1gb, 32bit AMD.

Here's my suggestion:
hda
Primary (hda1) ext3 / 11gb
Logical (hda2) ext3 /home 1gb
Extended
Logical (hda5) ext3 - 28gb
hdb
Primary (hdb1) swap swap 2gb
Primary (hdb2) ext3 / 10gb
Extended
Logical (hdb5) ext3 - 28gb

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.
melbo
Level 2
Level 2
Posts: 67
Joined: Fri Jan 04, 2008 11:57 pm
Location: WA, USA
Contact:

Re: How To: Partition your Hard Drive.

Post by melbo »

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...


What happens when I run with no swap partition or file?
User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: How To: Partition your Hard Drive.

Post by Fred »

melbo wrote:
What happens when I run with no swap partition or file?
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.

http://www.linuxmint.com/forum/viewtopi ... 90&t=11872

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.

http://www.linuxmint.com/forum/viewtopi ... 42&t=12988

Hope this is helpful.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
AK Dave
Level 6
Level 6
Posts: 1042
Joined: Wed May 14, 2008 3:39 pm
Location: Anchorage, AK USA

Re: How To: Partition your Hard Drive.

Post by AK Dave »

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".
User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: How To: Partition your Hard Drive.

Post by Fred »

AK Dave,

It is so nice to see somebody post on this topic that actually "gets it right" instead of posting myths and hearsay. :-)

Use the below to create a symlink:

ln -sf target_file/foldername symlink_filename

Example:
............ target folder/file path .........symlink path/name
ln -sf /media/sda7/Music/Country /home/fred/CountryMusic

If you are in the folder you wish to create the symlink in you don't need the path for the symlink, just the symlink name.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
chowanec
Level 3
Level 3
Posts: 104
Joined: Fri Dec 14, 2007 11:59 am

Re: How To: Partition your Hard Drive.

Post by chowanec »

1MB = 1024 bytes

Just multiply the math from there...?

:)
User avatar
mintyed
Level 2
Level 2
Posts: 88
Joined: Mon Mar 16, 2009 1:58 am

Re: How To: Partition your Hard Drive.

Post by mintyed »

i need to know how to set up a Linux mint hard drive from scratch

I want to partition most of it for Mint and some for XP

mint tells me i need to allocate a swap file what is this and do i need it

This is so confusing and different from XP so where to begin. Xp only needs one partition and its easy. no swap needed.
Enjoy It
Linux is many things to many people.
If you use it and it fits your needs enjoy it.
altair4
Level 20
Level 20
Posts: 10215
Joined: Tue Feb 03, 2009 10:27 am

Re: How To: Partition your Hard Drive.

Post by altair4 »

Xp only needs one partition and its easy. no swap needed.
Actually, that is not correct. WinXP does indeed need a swap file but it creates one automatically. In Windows the swap file is called pagefile and it's default location is C:\pagefile.sys.

Also, there is no law that states that you have to create a separate partition for every single linux directory. You could just create 2: "/" and "swap".
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
newW2
Level 5
Level 5
Posts: 821
Joined: Fri Apr 06, 2007 10:24 am
Location: USA

Re: How To: Partition your Hard Drive.

Post by newW2 »

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?
User avatar
newW2
Level 5
Level 5
Posts: 821
Joined: Fri Apr 06, 2007 10:24 am
Location: USA

Re: How To: Partition your Hard Drive.

Post by newW2 »

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.
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Re: How To: Partition your Hard Drive.

Post by marcus0263 »

This Heading Edited by gazza :- NOTE, this is NOT recommended for mint installs a simpler
3 partitions sda1 / , sda2 swap , sda3 /home is sufficient and best practice for future fresh installs.

Simple scheme for slicing up your drive, works for most. This is "assuming" you're running one drive -

/dev/sda1 /boot ext2 256 Meg (keep your kernel/kernels safe)
/dev/sda2 / ext4 8 Gig (should be good to go, give or take a little depending on the size of your disk)
/dev/sda3 /var/log ext4 256 Meg (so you don't have a run away daemon filling up logs then filling up your root file system)
/dev/sda5 /home ext4 rest of the disk minus swap, use gcalc to come up with the right amount
/dev/sda6 swap swap 256 - 512 Meg should be more than enough and keep it at the end of your disk (last partition)


It's simple and with gparted slicing up the drive is a simple process. Always keep boot, root and your logs on their own slice, I actually go farther and put /var, /usr/src, /usr/lib on their own slices also. But the above works well for 99% of the general users. Following the Microsoft worlds way of everything on one slice you're setting yourself up for problems.
Shuttle SX58
Intel i7 Gulftown Hex Core
G.Skill 16Gig 1333
OCS Vertex 2 SSD
Segate SATA II
Palit GeForce GTS 450
LMKDE 14 64Bit

Where Thought Crime is Committed
Reject the Herd
Husse
Level 23
Level 23
Posts: 18677
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: How To: Partition your Hard Drive.

Post by Husse »

One comment - if you want hibernate to work swap needs to be slightly larger than your memory
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
User avatar
ibm450
Level 5
Level 5
Posts: 623
Joined: Sun Jan 11, 2009 6:56 am
Location: Hamilton Hill, Western Australia

Re:

Post by ibm450 »

scorp123 wrote:
kenetics wrote:Thanks. One other question, will there be a /boot for each Linux OS and does Grub reside in the boot?
Each Linux installation has its /boot directory, yes. So this can either just be a sub-directory in each of the root directories of each installation ... or if you really want it super complicated, you could create each /boot for each Linux installation as a separate partition and mount point. The big question is: How are you going to partition your harddisk then so that these things don't get into each other's way ?? (It can be done ... but it's not easy!!) Also, something that you need to think ahead of: The GRUB installation of the last Linux distribution you install is most likely the one that will take control of the Master Boot Record of your harddisk. So when the PC boots, you'll first see the GRUB of the last Linux distribution you installed. All other Linux installations should still be selectable as boot options. Regardless of this, you can still always overwrite the MBR's GRUB with a GRUB from your currently running distribution, regardless in which order it was installed. You'll just have to make sure that the /boot/grub/menu.lst you want to use is right about the various menu entries and that everything is selectable. Basically you can copy and paste the relevant sections of each menu.lst file from one distribution to another (ain't that cool or what?)

My partitioning scheme which I posted in this thread was assuming that one would only have one Linux as the main OS and a Windows installation somewhere (e.g. for the casual game here and there).

With multiple Linux installations things might be slightly more complicated. Let's take a 120 GB disk as basis and let's assume you would install up to three Linux distros on it (e.g. for evaluation purposes). Let's assume we're talking about these fine Linux distributions:
  • - openSuSE 10.2
    - Linux Mint "Bianca"
    - Fedora Core 6
So here we go:
  • /dev/hda1 -- 15 GB openSUSE 10.2, containing everything but /home
    /dev/hda2 -- 15 GB Fedora Core 6, containing everything but /home
    /dev/hda3 -- 15 GB Linux Mint, containing everything but /home
    /dev/hda4 -- extended partition, from here to the end of the HD
    /dev/hda5 -- ca. 75-78 GB shared /home between all three distros (user names could nontheless be different between the three; having the same user name on all three may create new problems eg. with incompatible settings in GNOME and KDE ... with the help of symbolic links stuff like documents, browser settings, etc. could still be shared easily between all three distros and user accounts!) ...Very important: Make sure you only format this partition the first time (e.g. during the installation of the first Linux distro you want to use) and then don't format it in all subsequent installations! :wink: Or else: bye bye oh beloved files, bye bye browser settings, bye bye e-mails ... :wink:
    /dev/hda9 -- swap, whatever is left of the harddisk (e.g. 2 GB)


can not get to run 2 distros on my system. i install LM7 then LM6KDE and all turns pear shape. the system wont load up and KDE installation over writes LM7 grub. as far as creating the separate partitions i cant seem to understand how to use different partions to install other distros on to it. can some1 explain do a step to step tutorial on exactly what to do from partitions to installing other distros to modifying the grub etc.

also i find playing video files on LM very grainy and washed (even adjusting the sat - contrast levels) opposed to playing them in xp which play crisp clear
Sony i3 - VPCEB13FG SSD 4GB laptop ~ MX-Linux XFCE - LMDE-4 Cinnamon - LM 20 Cinnamon - Win 10 ENT
Image
FedoraRefugee
Level 6
Level 6
Posts: 1274
Joined: Fri Oct 03, 2008 11:25 am

IBM 450

Post by FedoraRefugee »

ibm450 wrote:can not get to run 2 distros on my system. i install LM7 then LM6KDE and all turns pear shape. the system wont load up and KDE installation over writes LM7 grub. as far as creating the separate partitions i cant seem to understand how to use different partitions to install other distros on to it. can some1 explain do a step to step tutorial on exactly what to do from partitions to installing other distros to modifying the grub etc.

also i find playing video files on LM very grainy and washed (even adjusting the sat - contrast levels) opposed to playing them in xp which play crisp clear
If you are still talking to me I can answer your grub issue. As was stated in the post you quoted the last Mint install is overwriting the grub of the first. Even here you have several ways to go, you could just use the first distro grub and not install any other grubs if the succeeding distros allow that, you could just use the last distro's grub to overwrite the first grubs in the MBR, you could install something like supergrub last to overwrite all distro grubs or you could chainload slave distro grubs from a single master distro grub. I suggest the last. The link Fred gave you in the other thread describes how to do this. The advantage is that each distro keeps its own grub so that if you update that distro's kernel it will be automatically written in that grub's menu.lst. This is a lot of info, huh? This is why I got "bitter" with your posts, you need to understand there is no "easy" one size fits all answer.

RE partitioning, do yourself a favor. I dont know if you are in the field right now or what your internet situation is like, but at first available opportunity go here:

http://sourceforge.net/project/showfile ... _id=173828

and download the latest gparted live CD and burn it to a disc. This is a small bootable Linux distro (Gentoo i believe) that will open with the Gparted partitioning tool open on the desktop. With this tool you can create and modify your partitioning layout easily. This is how you create your partitions. Just choose the layout you need. Use the above post, or the one Fred linked to, or even the layout I suggested in the other thread, here again, there are many options and everyone will argue over what's best. The answer to what is best is what works for you.

RE the /home thing, here again, I emphasize, create a /data partition. The above post's method will work, as long as you have different user names per distro. But WHY even bother? Just create a /data for your personal documents and share it between all distros and keep /home small and in the / partition of each distro.

I apologize for slamming you around in the other thread, we are all here to help. But you need to allow us to help you first! You will need to set up a dialog with someone and describe your needs. You will get personal attention and someone will walk you through this, but you need to understand that one size does not fit all.

I suggest you start a thread for each problem. One thread of your own for partitioning, another for the video problem.
MintyCat
Level 1
Level 1
Posts: 9
Joined: Sun Sep 27, 2009 7:58 am

Re: How To: Partition your Hard Drive.

Post by MintyCat »

I'm bringing this to life again, since I'm about to make a clean install of Gloria on my desktop and while searching the Linux Mint Wiki, I found an article on howto partition and it had a link for this thread, and I thought it would be interesting if you guys just gave me your opinion on my partitioning scheme, since I'm highly unsure of it, being used to just having a separate /home partition and a swap twice bigger than my RAM. :)

But first, let me say I've read the previous pages on this thread, and found some interesting opinions I would like to briefly discuss. :wink:
linuxviolin wrote:Personally I would say to you not to be bored, for a home user use simply 1 partition for / (about 10 GB should be enough) and 1 for /home, both in ext3.

For swap use 1 GB maximum and I recommend to you to lower the swappiness (that depends on your memory):

"The use of the swap memory by default on Kernel 2.6.xx is set to 60% that means that the system will use intensively the swap memory. This sounds good if we have a small amount of memory (around 512MB or less) and lot of load on our PC especially if it is working as server. But if we have plenty of RAM (at least 1GB), as I do which is 2GB, and we are using our PC as desktop machine for daily use, we can change the percentage of swap to be utilized. This setting will increase the performance of Linux experience." (Vichar Bhatt)

Run at the CLI, as root:

cat /proc/sys/vm/swappiness

You should see 60. Now change it to 10 (or even 0 as I did it, adapt according to your system, test):

sysctl -w vm.swappiness=10

Now is time to work for some minutes with some applications if you see that is better, you can make the changes permanent, adding this line at the end of /etc/sysctl.conf:

vm.swappiness=10
Well, I have to agree. A separate /home seems enough to me, the average desktop user. I don't run a server, but I do like to install new software, do some distro hopping but mainly I just listen to music, browse the web and write down some stuff. So why should I give myself an headache, creating all those partitions, when I know it's not worth it, given the circumstances. And with so many partitions, anyone is bound to be confused, and when I install or upgrade an distro, I like it to be as smooth and clean as possible, and I think the average Joe/Jane, thinks the same. If they didn't, they would probably not be reading this thread. :wink:

And very useful tip you got us there, linuxviolin! Many thanks. :D

I have 3GB RAM on both my desktop and laptop, and I was so worried it wasn't enough I always did a swap partition with at least 5GB. Prolly I just need 3GB, maybe less, right? :?:
nelamvr6 wrote:
scorp123 wrote:And where should it put /home? On your Windows partition? Before or after " / "? On a separate disk? On your USB stick? On your external harddisk? .... You see the problem?
No, I can't see the problem at all!

At this point I will have told the installer I want to, for example, use the largest free contiguous space for my Linux installation.

Why can the installer take that specification, and then divvy it up appropriately between /, /home and swap?

I didn't tell the installer where I wanted my swap partition, how did it know where to put that?
You want a separate /home => you've got to define it, partition your harddrive and then tell the installer to mount your /home there.
Why? I mean, we're speaking in hypotheticals here, and we all want to make Linux better, right? Why should I have to tell it anything?
UNIX-like OS simply expect that *You* know what you do.
And this is what has to change if we want broader acceptance of Linux on the desktop.

All I know is that I'm not a dummy, and I'm not completely computer illiterate either. But the installer never even mentioned a separate /home partition. Only after installing, only then do I read both you and Clem posting that one should at a minimum have a separate /home partition!

I understand what you are saying, but isn't Mint about making things work the right way out of the box? Why can't the installer at least ask me if I want a separate /home partition?
This was a very productive discussion in my opinion, and an interesting theme that Linux users should discuss with developers, so we can all work together and make things as simple but still as reliable as possible. Aren't we supposed to evolve after all? :wink:

I know Linux is all about control and choice, but at least distros like Linux Mint should make an effort to incorporate suggestions like these on their systems, making it even easier for a new user to come into this scary and unknown world. Maybe during the install process, prompt the availability of a root account or the creation of a /home partition, if the user wishes so, but at the same time, inform the user of what they're doing, the consequences or the importance to rely on solutions like those. You know, live to the expectation, giving the hand so the user can give the first steps without falling, and when the user finally learns how to support himself enough to walk, have the option to change to a much complex and challenging distro. mintAssistant was just the tip of the iceberg, I think we should go deeper, try out something like Ubuntu Karmic's presentation screens, that let the user know, in a simple and clear language, what they're about to meet when the log in into their new system, what apps they have available, etc. Use that as a model, and make something like it, that accommodates the user's journey through the install. :)

And now, finally, my partitioning scheme, followed by some questions:

HDD -- 500GB

/dev/sda1: /boot [150 MB]
/dev/sda2: / [20GB, because here apps get installed, right? so I need some space]
/dev/sda3: extended partition, up and until the end of the disk
/dev/sda4: /usr [5GB, what's this for?]
/dev/sda5: NFTS (Factory_Image)
/dev/sda6: /opt [2GB, is that enough or those files get stored in / if this partition doesn't exist?]
/dev/sda7: /var [2GB, do I need this if I'm not running a server?]
/dev/sda8: /home [Rest of the disk]
/dev/sda9: swap [3GB, since I have 3GB RAM]

Supposedly I don't need /srv since I don't run a server, right? :?

And I already have an Windows partition, which contains a recovery image of Vista, and I think it's located in between /usr and /opt. Is there any problem with that? If there is, how can I work it out? :?

And can someone explain to me how do I make that extended partition? What's it for?

Hopefully I haven't got you guys bored, or actually sleeping, I just like to make my contribution to the project the way I can, giving suggestions and participating on the forum. At least for the moment, because I plan on helping much more. Thank you all guys for your time! :D
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Re: How To: Partition your Hard Drive.

Post by marcus0263 »

MintyCat wrote:<snip>
And now, finally, my partitioning scheme, followed by some questions:

HDD -- 500GB

/dev/sda1: /boot [150 MB]
/dev/sda2: / [20GB, because here apps get installed, right? so I need some space]
/dev/sda3: extended partition, up and until the end of the disk
/dev/sda4: /usr [5GB, what's this for?]
/dev/sda5: NFTS (Factory_Image)
/dev/sda6: /opt [2GB, is that enough or those files get stored in / if this partition doesn't exist?]
/dev/sda7: /var [2GB, do I need this if I'm not running a server?]
/dev/sda8: /home [Rest of the disk]
/dev/sda9: swap [3GB, since I have 3GB RAM]

Supposedly I don't need /srv since I don't run a server, right? :?
Nope, don't need /srv
MintyCat wrote:And I already have an Windows partition, which contains a recovery image of Vista, and I think it's located in between /usr and /opt. Is there any problem with that? If there is, how can I work it out? :?
Yep, it'll be fine
MintyCat wrote:And can someone explain to me how do I make that extended partition? What's it for?
"extended" get by the hard set 4 partition limitation, by created an "extended" slice you can therefore create more slices in the "extended" slice.
MintyCat wrote:Hopefully I haven't got you guys bored, or actually sleeping, I just like to make my contribution to the project the way I can, giving suggestions and participating on the forum. At least for the moment, because I plan on helping much more. Thank you all guys for your time! :D
I though would change your scheme to this -
/dev/sda1: /boot [150 MB]
Fine

/dev/sda2: / [20GB, because here apps get installed, right? so I need some space]
Don't really need this much, I would only have 10 - 12 GB at most here

/dev/sda3: extended partition, up and until the end of the disk
Yep

/dev/sda4: /usr [5GB, what's this for?]
Fine, maybe even bump it up to 8 GB. This is where most of your programs and libraries are stored

/dev/sda5: NFTS (Factory_Image)
Fine

/dev/sda6: /opt [2GB, is that enough or those files get stored in / if this partition doesn't exist?]
You could remove this completly, not many programs us the /opt file system, some do though and it's safe to be on the root slice

/dev/sda7: /var [2GB, do I need this if I'm not running a server?]
You're going to run into issues with only 2GB here IMO. I would bump this up to at least 5 GB. I also recommend having a slice for /var/log at around 256 MB, this will prevent a misbehaving daemon filling up the logs to bleed over and corrupting critical system files. I always put /var/log on it's own slice.

/dev/sda8: /home [Rest of the disk]
Yep

/dev/sda9: swap [3GB, since I have 3GB RAM]
Don't need this much, I'd personally cut it down to 512MB. But if you plan on using "suspend to disk" (which I never do) you will need a bit over the amount of RAM you have installed. If you're going to use "Suspend to Disk" I'd go amount of RAM + 128 - 256 MB
Shuttle SX58
Intel i7 Gulftown Hex Core
G.Skill 16Gig 1333
OCS Vertex 2 SSD
Segate SATA II
Palit GeForce GTS 450
LMKDE 14 64Bit

Where Thought Crime is Committed
Reject the Herd
MintyCat
Level 1
Level 1
Posts: 9
Joined: Sun Sep 27, 2009 7:58 am

Re: How To: Partition your Hard Drive.

Post by MintyCat »

marcus0263 wrote: "extended" get by the hard set 4 partition limitation, by created an "extended" slice you can therefore create more slices in the "extended" slice.

I though would change your scheme to this -
/dev/sda1: /boot [150 MB]
Fine

/dev/sda2: / [20GB, because here apps get installed, right? so I need some space]
Don't really need this much, I would only have 10 - 12 GB at most here

/dev/sda3: extended partition, up and until the end of the disk
Yep

/dev/sda4: /usr [5GB, what's this for?]
Fine, maybe even bump it up to 8 GB. This is where most of your programs and libraries are stored

/dev/sda5: NFTS (Factory_Image)
Fine

/dev/sda6: /opt [2GB, is that enough or those files get stored in / if this partition doesn't exist?]
You could remove this completly, not many programs us the /opt file system, some do though and it's safe to be on the root slice

/dev/sda7: /var [2GB, do I need this if I'm not running a server?]
You're going to run into issues with only 2GB here IMO. I would bump this up to at least 5 GB. I also recommend having a slice for /var/log at around 256 MB, this will prevent a misbehaving daemon filling up the logs to bleed over and corrupting critical system files. I always put /var/log on it's own slice.

/dev/sda8: /home [Rest of the disk]
Yep

/dev/sda9: swap [3GB, since I have 3GB RAM]
Don't need this much, I'd personally cut it down to 512MB. But if you plan on using "suspend to disk" (which I never do) you will need a bit over the amount of RAM you have installed. If you're going to use "Suspend to Disk" I'd go amount of RAM + 128 - 256 MB
Oh. So let me see if I caught the drill...

/dev/sda1: /boot [150 MB]
/dev/sda2: / [15GB, just in case]
/dev/sda3: extended partition, up and until the end of the disk [in which /usr, /var, /home and swap are included, right?]
/dev/sda4: /usr [10GB, since I like to install stuff :P]
/dev/sda5: NFTS (Factory_Image)
no more /opt, since whatever was supposed to be here it will be stored in /, am I right?
/dev/sda7: /var [5GB, but how do I make a slice for /var/log? Make /var extended?]
/dev/sda8: /home [Rest of the disk]
/dev/sda9: swap [512MB? Even if I want video editing, compiz and games?]

Thank you very much for your help and quick response :D
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Re: How To: Partition your Hard Drive.

Post by marcus0263 »

MintyCat wrote:Oh. So let me see if I caught the drill...

/dev/sda1: /boot [150 MB]
/dev/sda2: / [15GB, just in case]
/dev/sda3: extended partition, up and until the end of the disk [in which /usr, /var, /home and swap are included, right?]
/dev/sda4: /usr [10GB, since I like to install stuff :P]
/dev/sda5: NFTS (Factory_Image)
no more /opt, since whatever was supposed to be here it will be stored in /, am I right?
/dev/sda7: /var [5GB, but how do I make a slice for /var/log? Make /var extended?]
/dev/sda8: /home [Rest of the disk]
/dev/sda9: swap [512MB? Even if I want video editing, compiz and games?]

Thank you very much for your help and quick response :D
You'll need to move slices around, but remember this

swap should to be your last slice
/home next to last
/var/log
/var

Don't loose any sleep over that though, but it's best due to those file systems are written to the most, thus should be on farthest out to the edge of the disk. It's just "good form" to set it up that way. Here's how I would slice up a disk

sda1 /boot
sda2 /
sda3 /usr/src
sda4 extended
sda5 /usr
sda6 /var
sda7 /var/log
sda8 /home
sda10 swap

As for creating a new slice for /var/log you'll need to use gparted which is the easiest for noob's. You can use it to resize, create new slices, delete slices, etc.

Now for the question about the swap, if you're nailing your swap for anything over a few meg here and there you've got bigger things to worry about. I've got my swappiness set to 5 and I very rarely touch it, 512MB should be more than enough. And yes I use the Gimp and have all the 3D eye candy turned on
Shuttle SX58
Intel i7 Gulftown Hex Core
G.Skill 16Gig 1333
OCS Vertex 2 SSD
Segate SATA II
Palit GeForce GTS 450
LMKDE 14 64Bit

Where Thought Crime is Committed
Reject the Herd
User avatar
atlef
Level 4
Level 4
Posts: 306
Joined: Sun Nov 18, 2007 8:20 am
Location: Stavanger NORWAY

Re: How To: Partition your Hard Drive.

Post by atlef »

/dev/sda1: / 10gb (filesystem ext4)
/dev/sda2: swap 2gb (if you want to hibernate make this atleast the size of your ram)
make the rest /home (filesystem ext4) on an extended partition))

That is all you need.
This is my opinion, these may vary from person to person though.

atlef.
User avatar
mzsade
Level 5
Level 5
Posts: 777
Joined: Sun Jul 19, 2009 4:36 am

Re: How To: Partition your Hard Drive.

Post by mzsade »

Speaking of opinions, check out mine, whenever i have to install a new release/reinstall after i mess up, i do it on my ext 4 sda 3, this way my data partition (sda 2, ext 3 for stability) is undisturbed and the partitions are maintained in the "correct disk order".
You may also want to consider viking777's views here: http://forums.linuxmint.com/viewtopic.php?f=46&t=32578
Attachments
Screenshot.jpeg
Screenshot.jpeg (64.59 KiB) Viewed 11242 times
Linux User #481272 Reg: 15th Sept., 2008
Post Reply

Return to “Tutorials”