LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2007, 12:25 AM   #1
amn
LQ Newbie
 
Registered: Mar 2007
Posts: 17

Rep: Reputation: 0
Partitioning dilemma - how to mount?


Hi all,

I have designed (on paper) that my new Linux install will use several partitions to form the single root filesystem. In details it looks like this:

/dev/sda1: /boot directory
/dev/sda5: swap partition
/dev/sda6: /var/log
/dev/sda7: /var
/dev/sda8: /tmp
/dev/sda9: /usr,/bin,/sbin,/lib,/opt
/dev/sda10: /, /dev, /proc
/dev/sda11: /home, /root

However i now come to realise that it in fact may not be possible to mount the /dev/sda9 partition properly, since as far as I understood about 'mount', it will mount a single device (partition in this case) at a single filesystem point. In other words, how will I be able to keep /usr,/bin,/sbin,/lib,/opt on a same partition, and fuse them into my root tree? I really dont want to split the partition into 5, one per directory, and I dont want to have a single partition for the drive...Is my design realisable?

The reason i split the layout like this, is to optimise disk usage, since outer tracks (lower partitions) are faster.

I am considering LVM but frankly, it only creates extra block devices which have to be mounted too, so I cannot see how it would help.

Thanks...

P.S. I have crossposted this question on linuxforums.org. I dont know much about policies of crossposting, hope it is fine though.
 
Old 11-27-2007, 02:01 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
lots of people will disagree with me but let me give you some tips.

If speed is you main concern, running default kernels and default initrd images and default modules and default services will slow you down more.

to be positive, compile your non-intrd kernel with min modules and run minimum services.

2) so if you agree, the need to have all those extra partitions become irrelevant. There are some who argue you must have this on a separate partition and I am no better. I suggest you save disk space by having the least number of partitions.

I have 3..../ and swap.....and one backup partition used for saving partimage images. It only takes me minutes to restore my entire system for an upgrade blah blah. Naturally I burn my images to dvdrw.

3) If you choose a non-journalised file system format you can speed up your boot time but I prefer XFS for that day when I have a power failure.

for your consideration

/ /dev/sda1
swap /dev/sda2
/backup /dev/sda3....all are primary partitions so a simple backup of mbr is a bonus.
 
Old 11-27-2007, 07:43 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I would never try to have a partitioning scheme this complicated---and I really question what the benefit would be.

This aside, I don't think it is possible to mount things the way you describe. When you mount a partition to /, then everything in / --and everything under it-- goes in that one partition. If you then mount another partition to--eg /bin, then everything in /bin goes to that partition. If you try to mount a partition to several different sub-directories, the same data will appear in all of them.
 
Old 11-27-2007, 12:25 PM   #4
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
Not a guru, but I think could make the trick:

1) Put those folders in the partition you want.
2) Mount them in /mnt/sda9 (or whatever you like). You will end with /mnt/sda9/usr, /mnt/sda9/bin, etc.
3) create (sym)links from / to those folders.

Question: How much do you expect to use your swap partition? If it is not very often, maybe you would want to "reduce its priority" :-).

Anyhow, I agree that the scheme seems complicated. Be careful on the sizes you assign to each partition. Resizing later can be a mess...

Hope this helps!
 
Old 11-27-2007, 01:51 PM   #5
zoranp
Member
 
Registered: Nov 2007
Location: Belgrade, RS
Distribution: Mandriva 2009.0 X86_64
Posts: 44

Rep: Reputation: 15
And do not forget that during boot you will need content of /bin, /sbin and /lib.

How do you expect to mount /bin when executable (mount) resides in this folder?
 
Old 11-27-2007, 02:01 PM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,307
Blog Entries: 61

Rep: Reputation: Disabled
Keep It Simple. For the average desktop, two or three partitions are enough. Either / and swap; or /, /home, and swap.

Last edited by brianL; 11-28-2007 at 07:43 AM.
 
Old 11-28-2007, 12:10 AM   #7
amn
LQ Newbie
 
Registered: Mar 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by zoranp View Post
And do not forget that during boot you will need content of /bin, /sbin and /lib.

How do you expect to mount /bin when executable (mount) resides in this folder?
Ok, good point. How is mount available otherwise? I dont see how this is specific to /bin. How does the system bootstrap itself then, if it cannot mount partitions before mount is available, and mount is available on some partition anyways ?
 
Old 11-28-2007, 08:29 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In the bootloader configuration, the kernel line includes the info on which partition contains /
e.g. (for GRUB menu.lst):

..
..
kernel /boot/vmlinuz root=/dev/sda1
..
..

Later in the process, init looks at /etc/fstab for further instructions
 
Old 12-02-2007, 05:29 AM   #9
amn
LQ Newbie
 
Registered: Mar 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by zoranp View Post
And do not forget that during boot you will need content of /bin, /sbin and /lib.

How do you expect to mount /bin when executable (mount) resides in this folder?
Good point.

Btw, I remember reading on Inet of people giving advice of f.i. dedicating a separate partition for /boot also..Something like 50Mb or slightly larger. Does this mean /boot has to be the first mounted (by bootloader) partition?

Last edited by amn; 12-02-2007 at 05:35 AM.
 
Old 12-02-2007, 05:30 AM   #10
amn
LQ Newbie
 
Registered: Mar 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by enemorales View Post
Not a guru, but I think could make the trick:

1) Put those folders in the partition you want.
2) Mount them in /mnt/sda9 (or whatever you like). You will end with /mnt/sda9/usr, /mnt/sda9/bin, etc.
3) create (sym)links from / to those folders.

Question: How much do you expect to use your swap partition? If it is not very often, maybe you would want to "reduce its priority" :-).

Anyhow, I agree that the scheme seems complicated. Be careful on the sizes you assign to each partition. Resizing later can be a mess...

Hope this helps!
Yes, i thought of symlinking. Will go against this, but thanks for advice. Really.
 
Old 12-02-2007, 05:33 AM   #11
amn
LQ Newbie
 
Registered: Mar 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
In the bootloader configuration, the kernel line includes the info on which partition contains /
e.g. (for GRUB menu.lst):

..
..
kernel /boot/vmlinuz root=/dev/sda1
..
..

Later in the process, init looks at /etc/fstab for further instructions
Ok, after the bootloader mounts the partition specified by "root" argument, and when later init looks at /etc/fstab, does this mean init still does not need the "mount" binary, or does /bin have to be available already (incidentally from the place that "root" arg specifies, looks like) ?
 
Old 12-02-2007, 05:50 AM   #12
amn
LQ Newbie
 
Registered: Mar 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Some details on my setup:

1. I have a Lenovo T61 notebook waiting for this setup. Its a brick for now - i.e. clean disk

2. This will be part of automated install script, which will not be very robust since i am planning to initially only use it on the T61 machine

3. I believe significiant speed can be extracted by separating temp files, variable files, binaries, and user data onto different partition, especially for "average desktop" configuration which do some background disk stuff, like updating /var and /tmp content, since the categories of files that these partitions will host vary by lifetime, and nature of access. Besides, i would eventually like to experiment with filesystems on these different partitions, depending on the nature of files they host.

4. Swap partition is not strictly required, the noteboook has 2Gb RAM, yet i will use the swap space, just for the kicks Since the disk is 100Gb size, "reducing it's priority" (relocating it along the disk or even removing it altogether), as it occupies 1% of total disk platter capacity, will not yield any advantage, i think. So having it there, is only good if it will be used, when only 1% of total disk capacity "goes to waste".

I have to give up the layout of /dev/sda9 for reasons now obvious to me. The /usr, /bin, /sbin, /opt and /lib will go to where / is. The rest i am planning to keep.
 
Old 12-02-2007, 12:23 PM   #13
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by amn View Post

3. I believe significiant speed can be extracted by separating temp files, variable files, binaries, and user data onto different partition, especially for "average desktop" configuration which do some background disk stuff, like updating /var and /tmp content, since the categories of files that these partitions will host vary by lifetime, and nature of access. Besides, i would eventually like to experiment with filesystems on these different partitions, depending on the nature of files they host.
I think you won't notice any speed increase if you try this architecture using common desktop-grade hard drives, even SATA drives. You'll be bandwidth limited in your controller, and you will be dealing with a drive command set that won't reorder requests to optimize performance.

I think you might see some benefit if you used SCSI or SAS drives, but I doubt the performance gain would justify the cost of multiple SCSI drives just for this. If you used SCSI or SAS, your overall system performance would be significantly better than a standard desktop system just because of the drives you were using; the additional delta for the partition structure you want might not be necessary or worth it.

If you did want to go with multiple SCSI drives, then using striped sets probably gives more performance advantage than breaking out partitions as you propose.
Quote:
4. Swap partition is not strictly required, the noteboook has 2Gb RAM, yet i will use the swap space, just for the kicks Since the disk is 100Gb size, "reducing it's priority" (relocating it along the disk or even removing it altogether), as it occupies 1% of total disk platter capacity, will not yield any advantage, i think. So having it there, is only good if it will be used, when only 1% of total disk capacity "goes to waste".
Swap is always a good thing.

Quote:
I have to give up the layout of /dev/sda9 for reasons now obvious to me. The /usr, /bin, /sbin, /opt and /lib will go to where / is. The rest i am planning to keep.
or use symlinks.

Last edited by jiml8; 12-02-2007 at 12:25 PM.
 
Old 12-03-2007, 04:31 PM   #14
zoranp
Member
 
Registered: Nov 2007
Location: Belgrade, RS
Distribution: Mandriva 2009.0 X86_64
Posts: 44

Rep: Reputation: 15
Quote:
Originally Posted by amn View Post
Good point.

Btw, I remember reading on Inet of people giving advice of f.i. dedicating a separate partition for /boot also..Something like 50Mb or slightly larger. Does this mean /boot has to be the first mounted (by bootloader) partition?
Once upon a time BIOS was able to access only first 528MB of HDD, later 2GB or 8GB. Up to date mobos do not have these restrictions. As kernel is initially loaded by BIOS, it must reside in the area of the HDD visible by BIOS. If you create /boot partition as the first partition and size it 50MB you play on the safe side - its content will be visible by BIOS.

This is not a concern nowadays.
 
Old 12-03-2007, 04:33 PM   #15
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by zoranp View Post
Once upon a time BIOS was able to access only first 528MB of HDD, later 2GB or 8GB. Up to date mobos do not have these restrictions. As kernel is initially loaded by BIOS, it must reside in the area of the HDD visible by BIOS. If you create /boot partition as the first partition and size it 50MB you play on the safe side - its content will be visible by BIOS.

This is not a concern nowadays.
It remains a concern if you wish to use the logical volume manager (LVM). /boot won't work in an LVM environment; you have to set up a separate partition for /boot if you are going to use LVM.
 
  


Reply

Tags
lvm, mount, partition, partitioning


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
advice on partitioning and mount points please Nonc Linux - General 9 11-11-2007 01:34 PM
Yet another partitioning & mount point question cwlee Linux - Newbie 3 12-06-2004 02:45 AM
Partitioning: Where to mount raid 0 musicman_ace Linux - Hardware 1 05-11-2004 05:34 PM
Partitioning: File systems and Mount points Ice Dragon Linux - Newbie 3 03-11-2004 03:00 PM
New mount points and partitioning help sedulous Linux - Newbie 5 10-10-2003 07:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:25 AM.

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