LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-30-2006, 12:08 AM   #1
General
Member
 
Registered: Aug 2005
Distribution: Debian 7
Posts: 526

Rep: Reputation: 31
Extended partitions? Location of partitions?


I have setup some custom partitions on my machine, but I want to ensure that I have done this correctly. Taking advice from Slackware's documentation, I split my FC5 into the following partitions, all on one harddrive:
Code:
/dev/hdc1 /boot (150 MB)
/dev/hdc2 /usr  (3 GB)
/dev/hdc3 /     (2 GB)
/dev/hdc4 (the extended partition, this includes hdc5 through 9)
/dev/hdc5 /var  (1 GB)
/dev/hdc6 /tmp  (1 GB)
/dev/hdc7 swap  (512 MB)
/dev/hdc8 /home (29 GB)
Some things puzzle me:
  1. When I run df, an item called tmpfs, mounted on /dev/shm appears showing 128048 space available. I gave swap 512 MB, so what is this item?
  2. Partitions seem to be named hdc1, hdc2, etc. Does it matter which partitions are first? Should /boot, /, or swap be first?
  3. Does it matter which partitions are included on the extended partition?
  4. Is there a reason to have /boot as ext2 (SuSE does this by default).

Last edited by General; 04-30-2006 at 12:55 AM.
 
Old 04-30-2006, 12:37 AM   #2
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
There is really no one correct way to partition your drive. It really depends on what you are doing. If you don't plan on installing a lot of software, but pla on creating a lot of user files (documents, etc), then make /usr small, and /home big (like you already have). If you plan on installing a lot of software, then /usr should be bigger.

/boot should be first if you plan on using lilo, and should be no larger than 1024M (I think that's the limit). Grub doesn't care, just so long as it is visible.

Having multiple directories can have both benefits and drawbacks. The benefits are when you want to upgrade or replace your distro, you can wipe everything except your home directory and start over, keeping your data and settings. The flip side is that one partition may run out, while another is far from full. What I have is a /boot partition of 780M (way more than enough, as only 13M is used for the two kernels installed), and the rest of the drive is an LVM partition. Inside the LVM partition, I have logical partitions for / and /home, that I can resize fairly easily. Another advantage is that if I need more space, and the drive is full, I can add a second drive to the LVM group, and spread across both drives (digital sprawl).

As to /boot being ext2, that's fairly normal. That partition shouldn't be written to unless you are installing a new kernel, or editing grub's menu, so the chances of corruption due to power failure is minimal.
 
Old 04-30-2006, 12:38 AM   #3
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
1.) I don't understand what your talking about, odds are someone else will though.
2.) No it dosen't matter which one is first. As long as thier setup properly in your fstab.
3.) No it dosen't matter. You can have the /boot there, or the /swap, /root, whatever, it dosen't matter.
4.) The reason that /boot is usally ext2 is because there is so litte there. ext2 is an older filesystem that works very well and is very stable. ext3 is a newer version of that filesystem that includes journaling. Journaling would be useless in /boot though because there are so few files there. Thats why most use ext2, its not overkill, but its definatly just enough.
 
Old 04-30-2006, 01:06 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,248

Rep: Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156Reputation: 4156
1) See ../Documentation/filesystems/tmpfs.txt

Strictly has nothing to do with swap - except that it can help fill it ...
 
Old 04-30-2006, 02:21 AM   #5
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
I put my /boot first then my swap. Boot first because I used to use lilo, but switched to grub. Swap was next because that is the fastest part of the drive. The rest is really up to you and what you need.

Rest has been covered I think.

 
Old 04-30-2006, 01:41 PM   #6
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
Quote:
Originally Posted by dalek
I put my /boot first then my swap. Boot first because I used to use lilo, but switched to grub. Swap was next because that is the fastest part of the drive. The rest is really up to you and what you need.

Rest has been covered I think.

This seems to be the way 99% of users I meet set up their machines.
 
Old 05-02-2006, 02:22 PM   #7
svarmido
Member
 
Registered: Apr 2006
Posts: 78

Rep: Reputation: 15
Recommended partitioning follows your scheme, listed below. But, first - "hdc"?
"hdc" normally refers to your cdrom... "hda" is the root directory of your hard drive. "hda1" is the first partition of the hard drive... Partitions are added up to 1024 gigabytes, after which your partitions are extended partitions. I can't tell you how Linux determines where to place partitions, but they are referred to as hda2, hda3, and so on.

/dev/hdc1 /boot (150 MB)
/dev/hdc2 /usr (3 GB)
/dev/hdc3 / (2 GB)
/dev/hdc4 (the extended partition, this includes hdc5 through 9)
/dev/hdc5 /var (1 GB)
/dev/hdc6 /tmp (1 GB)
/dev/hdc7 swap (512 MB)
/dev/hdc8 /home (29 GB)

Looks like your drive is 40 gigs. "/boot" - 50 megabytes. "/" 5 megs or you may unexpectedly run out of space. You want "/usr" to have at least 10 gigabytes since that is where most of your programs will install themselves (15 gigs would probably be better). "/home", depending on how many users you have, can range from anywhere betwee 5 gigabytes and up. If you are a single user, 8 gigs should be sufficient. "/var" should allow for the fact "Yum" temporarily downloads update headers and .rpms there. I'd recommend 5 gigs for "/var". One gig for "/tmp" is probably o.k., unless you will be using "flashgot". Also, "clamav" anti-virus scanner creates temporary files that can be HUGE. So, if you plan on using clamav you should increase the size of "/tmp" to say, 3 gigs. If you believe you may upgrade ram in the future, and it is a good idea in any case, I'd assign 1 gig to swap. Finally, I'd add "/opt" and assign 5 gigs. Some programs install themselves there, and you may want to use "alternatives" to manage java. See http://stanton-finley.net/. I haven't added up my recommended partition sizes, so if I've overshot your limit, just make proportionate adjustments.

Good Luck.
svarmido
 
Old 05-02-2006, 02:42 PM   #8
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Quote:
1. When I run df, an item called tmpfs, mounted on /dev/shm appears showing 128048 space available. I gave swap 512 MB, so what is this item?
Answered by syg00.

Quote:
2. Partitions seem to be named hdc1, hdc2, etc. Does it matter which partitions are first? Should /boot, /, or swap be first?
Doesn't matter.

Quote:
3. Does it matter which partitions are included on the extended partition?
Nope. The only issue is whether the bios can see lilo/grub to boot it. Provided your motherboard was made in this century, that should be a non-issue (old BIOSes can only see <1024 cylinders).
Linux itself doesn't care where you put it.

Quote:
4. Is there a reason to have /boot as ext2 (SuSE does this by default).
Boot only needs to be big enough to hold a few kernels, ~32MB should be more than enough. I think you used too much space here. The reason ext2 is used is because the journal file on reiser/ext2 is 32MB which would take up too much space on a small partition. Further, you only write to /boot when you install a kernel (and except for installing a kernel, you don't even need it mounted during normal use, so journalling isn't much of an issue).

Quote:
/dev/hdc1 /boot (150 MB)
/dev/hdc2 /usr (3 GB)
/dev/hdc3 / (2 GB)
/dev/hdc4 (the extended partition, this includes hdc5 through 9)
/dev/hdc5 /var (1 GB)
/dev/hdc6 /tmp (1 GB)
/dev/hdc7 swap (512 MB)
/dev/hdc8 /home (29 GB)
There is no "right" way to partition a drive but I would say:

/boot: is a little too big. As I said above, 32MB is usually plenty.

/usr: could do with being a bit bigger (depending on distro), but as long as you have enough room to install what you want, it's OK (/usr/local could go on a separate partition).

/: 2GB is more than you need for /, I use 128-256MB. (I also symlink /opt to /usr/opt, so it isn't on my / fs).

/var: depends on your distro. I use Slackware and 256MB is more than enough. OTOH, Gentoo recommends ~2GB since it compiles packages in /var/tmp. 1GB is OK.

/tmp: can be as much as you need, I only use 128MB (and /var/tmp if I need more space), but it's no big deal, 1GB is fine.

swap: 512MB is OK. You generally don't need more than that (if you do, buy some more memory).

/home: again, as much as you want (basically the rest of the drive).

One thing that I started doing recently is putting /home and /usr/local on the same partition (I have a mount point /data and symlink /home and /usr/local to /data/home and /data/local). That way, I can upgrade the distro without touching any stuff I've installed myself and it simplifies backups. Just a thought.

Quote:
Originally Posted by svarmido
"hdc" normally refers to your cdrom... "hda" is the root directory of your hard drive.
hdc is the master drive on the second ATA channel. It has nothing to do with any particular type of device, it might be a cdrom or it might be a hard drive (or something else).

And /dev/hda isn't a directory, it's a device file which refers to the entire drive (the master drive on the primary channel). This has nothing to do with directories.

Last edited by ioerror; 05-02-2006 at 02:56 PM.
 
Old 05-02-2006, 03:47 PM   #9
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
This is the beauty of Linux, you can do it the way you need to suit YOU. If you wait long enough, you'll have dozens of ways to do this. Pick the one that works right for you and go for it. More options the better.

Sure beats windoze.

 
Old 05-02-2006, 05:05 PM   #10
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
Quote:
Originally Posted by ioerror
There is no "right" way to partition a drive but I would say:
Agreed
Quote:
Originally Posted by ioerror
/: 2GB is more than you need for /, I use 128-256MB. (I also symlink /opt to /usr/opt, so it isn't on my / fs).
Be careful, this recomendation is ok, but only if follow up with the rest of his recomendations. If you don't make a seperate /usr, /var, and /tmp partition, then this will fill up really fast and give you some "no space on device" errors on boot.

Quote:
Originally Posted by ioerror
/home: again, as much as you want (basically the rest of the drive).
This is a good recomendation as well. But I would also recomend considering leaving 15G or so in case you deciede you want to dualboot later.

Quote:
Originally Posted by ioerror
One thing that I started doing recently is putting /home and /usr/local on the same partition (I have a mount point /data and symlink /home and /usr/local to /data/home and /data/local). That way, I can upgrade the distro without touching any stuff I've installed myself and it simplifies backups. Just a thought.
I like that. Perhaps you should make anticle on that in the LQWiki, so we can all learn how to. (mainly me )
 
Old 05-03-2006, 03:39 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Rep: Reputation: Disabled
Your /boot with ext2 will be fsck'ed every 15 (?) boots. If this bothers you, and only then, migrate it to ext3 ("tunefs -O" I think). The journal shouldn't be that large...
 
Old 05-03-2006, 03:50 AM   #12
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Quote:
Originally Posted by Penguin of Wonder
Be careful, this recomendation is ok, but only if follow up with the rest of his recomendations. If you don't make a seperate /usr, /var, and /tmp partition, then this will fill up really fast and give you some "no space on device" errors on boot.
Yeah, I should've stipulated that, oops.

Quote:
Originally Posted by Penguin of Wonder
This is a good recomendation as well. But I would also recomend considering leaving 15G or so in case you deciede you want to dualboot later.
Another good suggestion, why did I forget this?

Regarding combining /home and /usr/local, I'm sure I read that online somewhere a while ago, but I've only just got around to implementing it. Can't remember where now, I'll see if I can find it.

As for doing it, I just did this: create /home as usual, leave /usr/local on /usr, and after installing, edit /etc/fstab to change the mountpoint of /home to /data. Then, just move the contents of /home to /data/home and make the symlink, and ditto with /usr/local. There's no need to do anything funny during the install. You don't even need the /data really, you could just put /home on /usr/local/home or /usr/local on /home/local! I just prefer to have them as separate trees under the same mountpoint.

edit: Just remembered, it was on LinuxGazette, I think that talked about /usr/local/home.

Last edited by ioerror; 05-03-2006 at 05:50 AM.
 
Old 05-03-2006, 11:16 AM   #13
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
Thats sounds like a really good idea, although now that I think about it, Gentoo dosen't work like other distros in that you don't ever have to "upgrade" it in the same sence you do say Fedora from core 4 to 5. But I plan on dual-booting later with the extra space I left on my HDD, so I'll look into it then.
 
Old 05-03-2006, 02:01 PM   #14
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
That's why I like Gentoo so much. The changes are more gradual and you get new program versions faster than if you wait for the "upgrade". I try to sync and check for updates every few days and it is a LOT better than when I used Mandrake for sure.

Later

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
extended partitions pixellany Linux - General 4 03-28-2006 02:05 PM
fstab extended partitions Chrax Slackware 2 01-03-2005 06:19 PM
Primary and Extended Partitions Flossie Linux - Newbie 2 03-16-2004 12:25 PM
What can extended partitions be used for? imemyself Linux - Hardware 4 02-29-2004 06:55 PM
Can I mount extended XP partitions? Mystakill Linux - Newbie 3 05-16-2002 09:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration