How To: Partition your Hard Drive.

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

flyhippo wrote: I read that scorp123 recommend XFS or EXT3.
If in doubt use Ext3 ... It just works and is a good overall performer for every-day use. Those benchmarks are to be taken "cum grano salis" ... Unless you do some really special stuff (e.g. storage of tons and tons and tons of extremely large files ... for which XFS would be best) you won't even notice any significant speed difference in your every-day usage of your computer.
flyhippo wrote: Or I just need to know that XFS is the best file systems.
There is no such thing like a "best" filesystem. What is "best" or not highly depends on what you do with your system and how the filesystem can handle that. Generally people say that XFS is best when dealing with tons and tons of really huge files (e.g. 1000 DVD *.iso images, each beyond 4 GB in size ...) ... but if you don't have so many huge files, then XFS isn't necessarily the best choice for you.

As I said ... If you are in doubt: Use Ext3 ... it just works. 8)
flyhippo wrote: If I want to use windows running as well (since I need to run some windows softwares like filemaker, ms Project, etc) what is the best solution for me. Therefore dual boot is not the option since I have to log out one OS then login to other OS.
VMware Server ... it's available via Canonical's "commercial" repos and can easily be installed via apt-get install vmware-server ... or in GUI via Synaptic.
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Post by linuxviolin »

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
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

msgnomer wrote: HDB 120 GB
hdb1 /boot 150 MB
hdb2 / 5 GB
hdb3 extended partition to end
hdb5 /usr 20 GB
hdb6 /var 5 GB
hdb7 /tmp 2 GB
hdb8 /VMs (rest of disk) <- virtual box machine space (not sure I can actually do this. They may have to go in /home?)
/usr appears a little bit too large in my opinion, 10 GB would most likely suffice too and you'd still have plenty of space. /var is a bit large too with 5 GB ... but depending on what you intend to do with this machine (maybe you'll get plenty of log files?) it's maybe not a bad idea to make it this large. As for your /VMs ... you can do it if you do it right. E.g. you could create sub-directories underneath /VMs and then give those sub-directories to each user on your system. Example:

Code: Select all

sudo mkdir /VMs/user1
sudo mkdir /VMs/user2
...
sudo chown -R user1:user1sgroup /VMs/user1
sudo chown -R user2:user2sgroup /VMs/user2
Then, inside each user's /home directory the normal users could create a symbolic link to their sub-directory underneath /VMs, e.g. for "user1":

Code: Select all

cd /home/user1
ln -s /VMs/user1 ./my-virtual-machines
So the directory /VMs/user1 appears as /home/user1/my-virtual-machines in user1's home directory; so "user1" would not have to search on the disks, e.g. "OH man ... where the hell did I put that VMware image yesterday?? And where did my VirtualBox images go?" ==> now it would be easily accessible underneath your home directory, despite in fact being on a different disk partition (which is good BTW: Avoids fragmentation and helps the disk performance; and in case something goes terribly wrong it hopefully won't affect /home directly!).

Hope this was useful ....
msgnomer wrote: BIOS is already set to boot hdb first.
OK then. Otherwise I'd suggest to swap the Master/Slave setup but changing the boot order should work too.
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Post by linuxviolin »

msgnomer wrote:It's just a desktop system with one user.
Again personally I would say to you not to be bored to do as many different partitions and just to make / and /home (maybe /boot if you really want it). That is completely sufficient. It is just a personal opinion.

{scorp123, do not strike me! :lol:}
msgnomer wrote:hda2 /swap 3 GB (1.75 GB RAM)
I guess 3 GB seems excessive to me. 1 GB is sufficient:

http://www.extremetech.com/article2/0,1 ... 123,00.asp

"There is an old rule-of-thumb about the amount of swap space. The conventional wisdom says that you should have twice as much swap as RAM. A computer with 256 MB of RAM should start with 512 MB of swap. Although this is a good idea for memory limited systems, it isn't practical for high-end home user systems. If you have 1 GB of RAM, then you probably will never need swap space—and you are very unlikely to need 2 GB of swap unless you are planning on doing video editing or audio composition."

Personally I have 1 GB RAM and a 1 GB swap partition with swappiness at 0 (see my post above) with no problem. I am a simple desktop user. :)
Last edited by linuxviolin on Fri Aug 03, 2007 12:22 pm, edited 1 time in total.
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

linuxviolin wrote: Again personally I would say to you not to be bored
You maybe mean "bothered" ? To be bored is something entirely different ...
linuxviolin wrote: to do as many different partitions and just to make / and /home (maybe /boot if you really want it). That is completely sufficient. It is just a personal opinion.
I'd separate /var if anything. That stuff fills up all the time and having it on / together with all the static stuff (/usr, /opt, etc.) is ugly and slows the system down. /home should always be separate.
linuxviolin wrote: {scorp123, do not strike me! :lol:}
You're lucky..... I'm too tired. Tomorrow maybe? :lol:
msgnomer wrote: I guess 3 GB seems excessive to me. 1 GB is sufficient
Out of experience I'd suggest size of swap = size of RAM if you have 1 GB or more RAM. If your RAM size is less than 1 GB then size of swap = 2 * size of RAM. But I wouldn't recommend a swap larger than 4 GB ... I mean if you have to swap 4 GB around and still run "Out of memory" then something is seriously wrong anyway :wink: But for video editing 2-3 GB swap looks OK to me.
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Post by linuxviolin »

scorp123 wrote:You maybe mean "bothered" ? To be bored is something entirely different ...
Or annoyed maybe.... sorry for my a little approximate English! :oops:
scorp123 wrote:/home should always be separate.
Definitively YES!
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

linuxviolin wrote:
scorp123 wrote:You maybe mean "bothered" ? To be bored is something entirely different ...
Or annoyed maybe.... sorry for my a little approximate English! :oops:
scorp123 wrote:/home should always be separate.
Definitively YES!
If this is the case, is it possible to make this the default behavior for the Mint install routine?

I'm right this minute in the process of re-doing my partitions because when I asked the Mint installer to do the right thing it gave me a / and a swap, and nothing more.
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

nelamvr6 wrote: If this is the case, is it possible to make this the default behavior for the Mint install routine?
Sure, we could change it so that every Windows partition gets automatically formatted and deleted (too bad if you wanted to keep it). Or we make /home use 80% of your second hard disk (too bad if you don't have one). ..... :wink:

You see the problem, yes? No installer can replace human intelligence. *YOU* have to tell it what you want. To correctly guess the "right" partition scheme (and what is "right" or not is a hot topic in it self) for each and every user and each and every system is impossible. The other problem I see: Even if the installer did suggest to create a separate /home partition I fear it would confuse the heck out of newbies. Chances are also they'd get the sizes wrong, e.g. make /home too small because they don't realise yet what they need it for. Or they make " / " too small ... or they by accident delete their Windows partition because they thought they could re-use the same partitions and settings under Linux ... and and and.

It's better if the user informs himself and then decides for himself what he wants to do.
nelamvr6 wrote: when I asked the Mint installer to do the right thing it gave me a / and a swap, and nothing more.
See above. You want a separate /home? Then tell the installer.

If you think this is "unfriendly" try the Solaris installer for contrast ... it will overwrite whatever it finds and take no prisoners and show no mercy to whatever is on your harddisks. And it will enforce it's partitioning scheme: e.g. per default slice 0 is always root " / ", slice 1 is always swap, slice 2 always covers the entire disk from first sector to the last sector and is reserved for Solaris-internal use (this by accident also makes sure that normal partition programs get confused like hell when they see that the third partition overlaps with the rest ... but this is "normal" here!), slice 3 is always /export, slice 4 is always not really defined, slice 5 is always usually used for /opt, slice 6 is always /usr, and slice 7 is always /home ... and there are always exactly these 8 partitions, slices 0 - 7 on each Solaris disk. Not more. Not less. And nothing else .... usually.

Trust me, you don't want the Mint installer (or any other Linux installer) do this to you. Being able to tell the installer about your partitioning wishes is precisely what you as home user want. An installer that would enforce the "right" partitioning scheme whether you want it or not would make you very unhappy.
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

scorp123 wrote:
nelamvr6 wrote: If this is the case, is it possible to make this the default behavior for the Mint install routine?
Sure, we could change it so that every Windows partition gets automatically formatted and deleted (too bad if you wanted to keep it). Or we make /home use 80% of your second hard disk (too bad if you don't have one). ..... :wink:

You see the problem, yes? No installer can replace human intelligence. *YOU* have to tell it what you want. To correctly guess the "right" partition scheme (and what is "right" or not is a hot topic in it self) for each and every user and each and every system is impossible. The other problem I see: Even if the installer did suggest to create a separate /home partition I fear it would confuse the heck out of newbies. Chances are also they'd get the sizes wrong, e.g. make /home too small because they don't realise yet what they need it for. Or they make " / " too small ... or they by accident delete their Windows partition because they thought they could re-use the same partitions and settings under Linux ... and and and.

It's better if the user informs himself and then decides for himself what he wants to do.
nelamvr6 wrote: when I asked the Mint installer to do the right thing it gave me a / and a swap, and nothing more.
See above. You want a separate /home? Then tell the installer.

If you think this is "unfriendly" try the Solaris installer for contrast ... it will overwrite whatever it finds and take no prisoners and show no mercy to whatever is on your harddisks. And it will enforce it's partitioning scheme: e.g. per default slice 0 is always root " / ", slice 1 is always swap, slice 2 always covers the entire disk from first sector to the last sector and is reserved for Solaris-internal use (this by accident also makes sure that normal partition programs get confused like hell when they see that the third partition overlaps with the rest ... but this is "normal" here!), slice 3 is always /export, slice 4 is always not really defined, slice 5 is always usually used for /opt, slice 6 is always /usr, and slice 7 is always /home ... and there are always exactly these 8 partitions, slices 0 - 7 on each Solaris disk. Not more. Not less. And nothing else .... usually.

Trust me, you don't want the Mint installer (or any other Linux installer) do this to you. Being able to tell the installer about your partitioning wishes is precisely what you as home user want. An installer that would enforce the "right" partitioning scheme whether you want it or not would make you very unhappy.
Well, I tried to tell the Mint installer that I wanted a separate Home partition, but I was met with a very obtuse interface. In order for me to do this, I had to know a whole lot more about Linux than the average newb does, and though I'm not exactly a newb I had some troubles.

As it is right now, the Mint installer automatically makes a Root and a Swap partition, correct?

My part consists of telling the installer how much of my disk I want it to use, whether I want to resize the windows partition, use the largest free contiguous space, or take the whole drive, correct?

So within those constraints, why cant the Mint installer take the space I've assigned it, using my "human intelligence", and then use that space to make at least a /, /home and swap partitions?
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

nelamvr6 wrote: So within those constraints, why cant the Mint installer take the space I've assigned it, using my "human intelligence", and then use that space to make at least a /, /home and swap partitions?
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? You want a separate /home => you've got to define it, partition your harddrive and then tell the installer to mount your /home there.

The installer as it is right now gives you a working installation which is OKayish for most newbies ... but it isn't "optimal". Having a proper partitioning scheme with separate /boot, /usr, /var and /home partitions would be ideal. But not even professional products that cost several thousand dollars ship with such a sophisticated installer. It's not the installer's task to plan the partitioning for you. *You* have to do this.

UNIX-like OS simply expect that *You* know what you do. This is also the same reason why working under "root" is so dangerous as no matter what dangerous command you execute nobody and nothing will ask you "Are you sure?" ... UNIX-like OS simply assume: Yes, you are sure. Or why else would you have issued the command? :wink:

Same with partitioning. You didn't define a separate /home ... so you obviously don't want one :wink: It's not the installer's (or any other program's) task to tell you what you want or not. :wink:
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

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?
Husse

Post by Husse »

Why can't the installer at least ask me if I want a separate /home partition?
That would be a good thing - provided a complete noob understands.
There has been suggestions elsewhere that we should have some kind of "helper" - can't remember exactly what, when and where.
Possibly a few points shown after you start the installer and a suggestion to make a home partition from the installer - but leave the decision to you
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

Well, it would be nice.

Now here's a question that has risen in my mind now that I have a separate home partition:

Now that I have a separate home partition, how to I go about telling future installers that I have a separate home partition and that I would like to use it as such?

I mean, that was the main motivation for me to create a separate home partition, that when I upgrade to the next version of Mint I won't have to bother my home directory.

Do I simply let the installer create a home folder under it's new root structure and then install my partition as /home?

Or is there a way to make the Mint installer aware that my /home partition is there?
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

nelamvr6 wrote:Or is there a way to make the Mint installer aware that my /home partition is there?
Usually with most Linux installers you can tell them to use the partition in question as /home but *NOT* format it, e.g. use it "as is".

But your other approach would work too ... you could just install your new Linux OS over the previous " / " partition and then add your previous /home after the installation, e.g. by editing the relevant section in /etc/fstab so that it would mount /home again under the right place.
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

scorp123 wrote:
nelamvr6 wrote:Or is there a way to make the Mint installer aware that my /home partition is there?
Usually with most Linux installers you can tell them to use the partition in question as /home but *NOT* format it, e.g. use it "as is".

But your other approach would work too ... you could just install your new Linux OS over the previous " / " partition and then add your previous /home after the installation, e.g. by editing the relevant section in /etc/fstab so that it would mount /home again under the right place.
While I was mucking about trying to use the Mint installer partition tool to create my separate /home partition, I was met with frustration aplenty. It seems to me that the second method I mentioned may be easier. But is one method better than the other? I was thinking that I could boot the live CD, use the GParted tool to simply delete the old / partition, and then during the installation tell the installer that I want it to use the largest contiguous free space.

Am I correct in believing that a fresh installation would not have anything of great importance in the new /home folder?

Thanks for all the help by the way, I know that some of these newb question must be tiresome...
Husse

Post by Husse »

some of these newb question must be tiresome...
Not at all, when they are asked with afterthought as you do :)
The only "risk" with home on its own partition is that some old config files remain and your install does not become absolutely fresh
This happened to me. After installing Cassandra the menu still said Bianca and I still have mintConfig as Control Center not the Cassandra version - I've just not cared enough to fix that :)
The ubiquity installer is good in many respects compared to other installers, but it is a bit kinky when it comes to selecting partitions
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

msgnomer wrote:I used the gparted live cd first to do the partitioning and then I ran the mint live cd to install. Doing it that way was incredibly easy.

http://gparted.sourceforge.net/livecd.php
OK, how did you do this? Could you give me a step by step? I understand how to make partitions, that part is easy.

But I couldn't figure out how to tell the installer that a particular partition should be used as root and another partition used as /home etc.
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

Husse wrote:
some of these newb question must be tiresome...
Not at all, when they are asked with afterthought as you do :)
The only "risk" with home on its own partition is that some old config files remain and your install does not become absolutely fresh
This happened to me. After installing Cassandra the menu still said Bianca and I still have mintConfig as Control Center not the Cassandra version - I've just not cared enough to fix that :)
The ubiquity installer is good in many respects compared to other installers, but it is a bit kinky when it comes to selecting partitions
So I should allow the installer create a new /home folder, them migrate that folder over to my partition, and then install my partition as /home?

I used this how-to to achieve my current scheme:

http://www.psychocats.net/ubuntu/separatehome

I could copy files such as my .bashrc to a flash drive before hand and then restore them afterward.

Would I be in danger of destroying any of the data I'm trying to save?

Does the command:
find . -depth -print0 | sudo cpio --null --sparse -pvd /new/
do anything more than copy files from one home directory to the new one, or will it destroy my current home folder?
nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Post by nelamvr6 »

msgnomer wrote:
nelamvr6 wrote:
msgnomer wrote:I used the gparted live cd first to do the partitioning and then I ran the mint live cd to install. Doing it that way was incredibly easy.

http://gparted.sourceforge.net/livecd.php
OK, how did you do this? Could you give me a step by step? I understand how to make partitions, that part is easy.

But I couldn't figure out how to tell the installer that a particular partition should be used as root and another partition used as /home etc.
If I recall correctly, you tell it what to mount for each partition under "Edit" during the install process. So, say you made a /home partition - you click "edit" (it might be "edit partition" - I'm not sure of exact terms) and there you will see partition size, file system type, and a drop down list of available mount points (/boot, /home, /usr, /r, etc).
Thanks, I'll give it a try next time I upgrade, which will be the next Mint release.
Husse

Post by Husse »

Quote:
find . -depth -print0 | sudo cpio --null --sparse -pvd /new/
A very elaborate command that I have to slowly analyze to understand :)
This

Code: Select all

sudo cp -a -v -u /home/* /mnt/newhome/
copies everything from home to newhome without changing file permissions
taken from
http://www.linuxmint.com/wiki/index.php ... st_copying
Post Reply

Return to “Tutorials”