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
Lolo Uila
Level 5
Level 5
Posts: 576
Joined: Thu Mar 15, 2007 3:40 am
Location: Kapolei, Hawaii

Postby Lolo Uila » Sun Sep 02, 2007 4:31 pm

Is there a tool that can convert my home partition to primary (from logical) and resize it to fill the entire drive? I was looking through the parted manual and it doesn't appear that parted can do that.

I have Partition Magic, but it doesn't support the current version of ext3.

Husse
Level 23
Level 23
Posts: 19590
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Sun Sep 02, 2007 5:23 pm

Don't think so but if you want to use the drive entirely for /home it does not have to be a primary. You could just remove the rest and resize the logical to fit (almost) the entire drive (I think) This would however be a bit dangerous as you could loose data in the process
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

User avatar
Lolo Uila
Level 5
Level 5
Posts: 576
Joined: Thu Mar 15, 2007 3:40 am
Location: Kapolei, Hawaii

Postby Lolo Uila » Sun Sep 02, 2007 9:32 pm

Yea, I figure I'll just have to brute-force it (backup, repartition, restore, edit fstab). I suppose another option would be to convert back to ext2 and see what Partition Magic can do, then convert to ext3 again when finished (but that may be more trouble than it's worth).

Anyway... I already have backups of both my Windows & Linux drives, so I won't lose anything if something goes wrong. I did a full partition backup last week when I tried to get Linux running on an Intel RAID-0 array. The Linux part went okay, and wasn't even all that difficult. I had Mint booting off of the RAID volume with home in its original partition on my 80G drive. Grub wouldn't boot into my Windows 2000 install, though. Error-15 if I remember right. Googled around and tried everything suggested and just couldn't get Windows booting. Finally gave up and did a partition restore and went back to using the BIOS to change the boot order.

So today I was getting ready to just get rid of the RAID volume and run the drives individually, when I started wondering if something might have been wrong with the MBR of the RAID stripe... Partition Magic couldn't read it (bad MBR), but all of my other software could. At first that made me think it was just a PM issue, but after the grub problems I wasn't so sure.

Since I had partition backups of my 2 boot drives, I decided to just blow the RAID volume partitions away completely and use Partition Magic to set them up again. That went well. I set up my Windows boot partition, along with /, /usr, /var and swap for Linux, and 2 more NTFS data volumes to use up the rest of the space. Then I restored my Windows boot partition from the backup and booted my Mint live CD. From the live CD I reinstalled Mint to the RAID volume (using the dmraid software), and after going through the little contortions needed to get grub installed on the RAID volume I rebooted, and it WORKS! :) I can now dual-boot Mint & Win2K with grub from my Intel SATA RAID volume.

I'm probably still going to get rid of the RAID, but I'm gonna keep it for a week or so and see if I can really notice a worthwhile performance boost. First impression is that boot times are faster, but not dramatically so. Shutdown, however, is super-fast!

Thanks again to everyone helping out here! I have learned a great deal and gained a lot of confidence in Linux, and the helpful people here are largely responsible for that. This really is a great community.

Aloha, Tim

Husse
Level 23
Level 23
Posts: 19590
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Mon Sep 03, 2007 6:07 am

Interesting....
Unfortunately all (?) raid on consumer mobos is not hardware raid but some mix of soft- and hardware
You get a performance boost from RAID0 but not much (I have tested)
But what you really get is a total loss of data if the raid goes down
But thumbs up for backups :lol:
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

subgeniusd
Level 1
Level 1
Posts: 1
Joined: Wed Sep 05, 2007 9:07 am
Location: Atlanta,Georgia

Postby subgeniusd » Wed Sep 05, 2007 10:23 am

Hello people- I picked up a Linux Mag last week that included the Bianca live cd. Browsing WikiMint then this forum thread has been quite interesting. I used some of the suggestions for custom install/partitioning and am very pleased with the results.

I understand some of the objections regarding the default installer which might be confusing to a new Linux user who would have no idea what "hda" means much less what swap is. Making this thread sticky was a great idea.


If you think the Mint default is inadequate take a look at this Xandros 4.0 default partition table. At least Mint default puts swap in an extended partition. No wonder Xandros is a "bit" sluggish!!


IDE1 37.26Gb
Primary (hda1) linux-swap 360Mb
Primary (hda2) ReiserFs 36.91Gb /

Thanks to scorp123 and Husse and the rest.

I've only used a few distros with KDE and Xfce and don't understand this User = Root situation but I'll look elsewhere. Thanks again. D.

Wh1sper
Level 2
Level 2
Posts: 70
Joined: Sun May 20, 2007 7:38 am
Location: Germany
Contact:

Postby Wh1sper » Sat Sep 08, 2007 4:24 am

scorp123 wrote:I'd stay away from ReiserFS ... It crashed several times on me and took all the data with it to Nirvana. If you want reliability I'd go with ext3 or XFS.

Me too. 2 times Reiserfs 3 has blow up the root filesystem. Parts of the open systemfiles like some init.d scripts where part of the directory.
Not funny! and all the wondertools to repair are absolutly useless and make it harm more and more.
(the cause was not found. there was no crash but only init 6)
So I for myself use only extfs3, in future maybe exfs4
Mein Blog fuer Nerten und Linux Strategen http://zockertown.de/s9y/

Wh1sper
Level 2
Level 2
Posts: 70
Joined: Sun May 20, 2007 7:38 am
Location: Germany
Contact:

Postby Wh1sper » Sat Sep 08, 2007 4:41 am

I do not want to enter discussion about to partion the disk(s).
Just giving my thought. I am using this:

/ 10 Gig
/usr/local/ 45 Gig
/home 45 Gig
swap

Why /usr/local ?
I do not want install big games again and again after reinstall
I place my self made stuff always in /usr/loca/bin
why /home ? This is anwered more then one time.

why no /boot? I am using grub, so why?
why not /tmp /var ... because, this is my personal computer, no need for this and for not having lvm this is a very effective way to waste space.
And more partitions = more trouble :)

If possible I am using lvm, which I am greatly miss by default at linuxmint.
debian etch is doing this much better
(btw. I am working for a very large company, too I'm dealing with a sun cluster, there is be a use for /opt /serv /var ... but at home I have a fileserver with nfs... :)
Mein Blog fuer Nerten und Linux Strategen http://zockertown.de/s9y/

immyls

Re: How To: Partition your Hard Drive.

Postby immyls » Thu Mar 20, 2008 6:47 pm

Along the lines of how to partition:

Can you mount multiple drives to the same mount point? ie. hda3 mounted to /home and also hdb1 mounted to /home?

User avatar
Fred
Level 10
Level 10
Posts: 3351
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: How To: Partition your Hard Drive.

Postby Fred » Thu Mar 20, 2008 10:31 pm

immyls,

More accurately, you mount partitions, not physical drives. If the partition includes the entire drive then yes, you have also mounted the drive. There are some storage system setups that include more than one drive in a partition also. But what you mount is the partition.

You can mount a partition within the file system. For an example. Let's say you have a partition, sda5, that has music on it. Also, let's say you have a partition, sda6, that has pictures on it. You could make a folder in /home/Your_username called Music. And another called Pictures. Then mount sda5 to /home/Your_username/Music and sda6 to /home/Your_username/Pictures. You would then have a folder in your /home that would be called Music that would contain all your music on sda5 and another folder in your /home that would contain all your pictures on sda6.

Hope that answers your question.

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
atlef
Level 4
Level 4
Posts: 306
Joined: Sun Nov 18, 2007 8:20 am
Location: Stavanger NORWAY
Contact:

Re: How To: Partition your Hard Drive.

Postby atlef » Fri Mar 21, 2008 5:25 pm

It is good that I found back to this post, as I just remembered reading it, but couldn't for the love of me figure out where it was.
Thanks for the tips and suggestions made here. It has made my computing a little less of a hassle when I do upgrades/reinstalls and installs every so often.

Here is my set-up as fdisk -l sees it.

fdisk -l says wrote:$ sudo fdisk -l /dev/sda

Disk /dev/sda: 320.0 GB, 320072933376 bytes
240 heads, 63 sectors/track, 41345 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0xed3eed3e

Device Boot Start End Blocks Id System
/dev/sda1 * 1 35 264568+ 7 HPFS/NTFS vista's (/boot)
/dev/sda2 36 41345 312303600 5 Extended
/dev/sda5 36 7145 53751568+ 7 HPFS/NTFS vista (/) mounted in /media/vista
/dev/sda6 7146 41345 258551968+ 7 HPFS/NTFS other (/usr) mounted in /media/vistabckup

$ sudo fdisk -l /dev/sdb

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe89ce89c

Device Boot Start End Blocks Id System
/dev/sdb1 17 9154 73400985 7 HPFS/NTFS W2 (/home) mounted in /media/vistadoc
/dev/sdb2 * 1 16 128488+ 83 Linux /boot
/dev/sdb3 9155 14593 43688767+ 5 Extended
/dev/sdb5 9155 9652 4000153+ 83 Linux /
/dev/sdb6 9653 10150 4000153+ 83 Linux /usr
/dev/sdb7 10151 10399 2000061 83 Linux /var
/dev/sdb8 10400 14460 32619951 83 Linux /home
/dev/sdb9 14461 14593 1068291 82 Linux swap / Solaris

Partition table entries are not in disk order (I am aware of this one)


atlef.

wesireal
Level 1
Level 1
Posts: 26
Joined: Fri Apr 04, 2008 5:42 pm

Re: How To: Partition your Hard Drive.

Postby wesireal » Wed Jun 04, 2008 4:13 pm

This thread is titled; How to partition your hard drive. It is everything but............

It is a thread where everyone is looking to prove that his/her partition scheme is better than everybody else's.

PLEASE is there a tutorial that actually teaches one to partition the hard drive and all schemes be damned? :evil:

Husse
Level 23
Level 23
Posts: 19590
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: How To: Partition your Hard Drive.

Postby Husse » Wed Jun 04, 2008 5:58 pm

to partition the hard drive and all schemes be damned?

Theoretically impossible :)
What/how ever you do it is a scheme :)
Take a look at this wiki
http://www.linuxmint.com/wiki/index.php ... _partition
As so often written by yours truly and supposes you dual boot with XP
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

wesireal
Level 1
Level 1
Posts: 26
Joined: Fri Apr 04, 2008 5:42 pm

Re: How To: Partition your Hard Drive.

Postby wesireal » Wed Jun 04, 2008 7:12 pm

I have already read the wiki.It presents grand schemes and then tell to use Gparted.I have not been able to find a tutorial on how to use gparted, without it I do not know where to begin!!!!!!!!

User avatar
Fred
Level 10
Level 10
Posts: 3351
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: How To: Partition your Hard Drive.

Postby Fred » Sun Jun 08, 2008 11:53 am

wesireal,

Below is a pretty good How-To for Gparted. There are others if you take the time to Google for them. I have recommended this one before with pretty good results.

http://www.howtoforge.com/partitioning_with_gparted

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
Eric Weir
Level 2
Level 2
Posts: 93
Joined: Sat May 31, 2008 3:06 pm
Location: Decatur, GA USA

Re: How To: Partition your Hard Drive.

Postby Eric Weir » Wed Jun 11, 2008 3:57 pm

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?

Thanks,
Eric Weir
Decatur, GA USA
Linux Mint 5

User avatar
Eric Weir
Level 2
Level 2
Posts: 93
Joined: Sat May 31, 2008 3:06 pm
Location: Decatur, GA USA

Re: How To: Partition your Hard Drive.

Postby Eric Weir » Wed Jun 11, 2008 4:06 pm

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?

Thanks,
Eric Weir
Decatur, GA USA
Linux Mint 5

User avatar
AK Dave
Level 6
Level 6
Posts: 1043
Joined: Wed May 14, 2008 3:39 pm
Location: Anchorage, AK USA

Re: How To: Partition your Hard Drive.

Postby AK Dave » Wed Jun 11, 2008 5:42 pm

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

This is suggestion #1:
Primary (sda1) ext2 /boot 128meg
Primary (sda2) swap swap 2gig
Primary (sda3) ext3 / 12gig
Extended
- Logical (sda5) ext3 /home 1gig
- Logical (sda6) ext3 (the rest of the drive)

This is suggestion #2:
Primary (sda1) swap swap 2gig
Primary (sda2) ext3 / 12gig
Primary (sda3) ext3 /home 1gig
Extended
- Logical (sda5) ext3 (the rest of the drive)

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.

User avatar
Eric Weir
Level 2
Level 2
Posts: 93
Joined: Sat May 31, 2008 3:06 pm
Location: Decatur, GA USA

Re: How To: Partition your Hard Drive.

Postby Eric Weir » Wed Jun 11, 2008 9:18 pm

AK Dave wrote:Do you have specific application reasons to actually need seperate partitions for /var and /usr?
No. I was just going with what the guy back at the beginning of the thread, the one with long experience as a Unix system administrator, recommended.

This is suggestion #2:
Primary (sda1) swap swap 2gig
Primary (sda2) ext3 / 12gig
Primary (sda3) ext3 /home 1gig
Extended
- Logical (sda5) ext3 (the rest of the drive)

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

I really appreciate your help.

Sincerely,
Eric Weir
Decatur, GA USA
Linux Mint 5

User avatar
AK Dave
Level 6
Level 6
Posts: 1043
Joined: Wed May 14, 2008 3:39 pm
Location: Anchorage, AK USA

Re: How To: Partition your Hard Drive.

Postby AK Dave » Thu Jun 12, 2008 12:29 am

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.

Postby melbo » Thu Jun 12, 2008 1:27 am

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?


Return to “Tutorials”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests