Mount points to folders instead of partitions

Associate
Joined
29 Jan 2007
Posts
727
I'm installing MINT to a PC and it seems you can only redirect a single mount point to an entire volume/partition, not individual folders on a partition.

This seems a little strange. Surely you could have one partition containing a home and tmp folder, then mount /tmp and /home to those folders?

Can this be done during the install?
 
Last edited:
yup, you just have to go advanced/custom partitioning during the install where you set up the partitions yourself.

This is the part that loses me every time I get to this screen (advanced/custom) during setup and abandon it (yep a newbie :D)

You need

/
/swap
/home

as a minimum? Should Google it again :)
 
yup, pretty much. :)

you also need a /boot...

http://tech.jonathangardner.net/wiki/Partitioning_Drives_in_Linux had a quick look over that and seemed pretty spot on... Also, I believe that ubuntu when you go to custom\advanced it will show you a partition table, but then just allow you to add another in, i.e. /home

My partition table is as follows:

60Gb SSD:

/boot - 194Mb
/swap - 4.1Gb
/ - everything else

250Gb HDD:

/home
 
Last edited:
yup, you just have to go advanced/custom partitioning during the install where you set up the partitions yourself.

Thanks for the response.

But what about setting two mount points on the SAME partition containing the relevant folders - like I mentioned in the opening post.

I want one large partition containing two folders - tmp and home. I've found temp and home can become very large, so I want them both on one large partition rather than limiting space by giving them a partition each.

Then set the mount points for /tmp /home to point to those two folders on the one large partition.
 
my tmp hasn't really seen all that much action, and I've been using this box for about 3 months without cleaning it up, and this is my work machine, so it gets used way more than my home machine, not sure what you store in tmp, but mines near on empty :)


rich@yggdrasil:/tmp$ sudo du -h
[sudo] password for rich:
4.0K ./.ICE-unix
4.0K ./ssh-GKYMyR1520
4.0K ./.esd-1001
8.0K ./pulse-J95Wt6TR8YbY
4.0K ./keyring-3lG9KM
4.0K ./orbit-gdm
4.0K ./.esd-113
4.0K ./.X11-unix
4.0K ./.com.google.chrome.2wGfWy
4.0K ./virtual-rich.yhZj07
8.0K ./orbit-rich
4.0K ./pulse-PKdhtXMmr18n
64K .
 
Thanks for the response.

But what about setting two mount points on the SAME partition containing the relevant folders - like I mentioned in the opening post.

I want one large partition containing two folders - tmp and home. I've found temp and home can become very large, so I want them both on one large partition rather than limiting space by giving them a partition each.

Then set the mount points for /tmp /home to point to those two folders on the one large partition.

This is where I always find the word "folder" misleading...

Am I barking up the wrong tree when I think you want the directories tmp and home in 1 partition by themselves?

Sorry to muddy the waters :(
 
This is where I always find the word "folder" misleading...

Am I barking up the wrong tree when I think you want the directories tmp and home in 1 partition by themselves?

Sorry to muddy the waters :(

That's exactly what I mean. :)

Yes in this case I mean folders = directory = drawers (if you use an Amiga). Why not chuck path in there too! :D

I think I explained it clearly, but my head may be warped! :D

As for tmp - it gets used to create some big files when I'm recording and burning, making albums and editing video etc. Files left in there aren't too bad once apps close down. But that's getting side tracked.

I just want to know if you can only have one mount point (a mount point being home, tmp, boot, etc) per partition when installing. Or can I specify two mount points on a single partition?

Basically I want (with sda1:, sda2: and sda3: being three separate partitions, not sure if these labels are right but bare with me)

Hard Disk 1 Partition 1 Mount Point = / (root)
PATH = sda1:

Hard Disk 2 Partition 1 = SWAP
PATH = sda2:

Hard Disk 2 Partition 2 Mount Points = /home AND /tmp
PATHS = sda3:home AND sda3:tmp
 
Last edited:
This may not be the right way to go about it.. but i think you could create the root (disk1 - whole disk) and swap (disk2 - small partition) during install.. and then after install you can create a new partition in the unallocated space in disk2 and then create /home and /tmp in the new partition. I'm not sure how you would tell the system to use the new partition for these pusposes rather than the ones on the root drive. A symlink from the root folders would probably work (but isn't the right way) - I guess manually editing fstab afterwards to point to the new folders may be the way?
 
Last edited:
You may be right masterluke, in that I have to bind or create links after MINT is installed. I can't see a way of doing it beforehand as it seems 1 partition = 1 mount point for the file system. 1 partition can't hold 2 mount points on install.

I'm brand new to Linux, and learning fast. From what I can tell you have a single "File System" with a fixed layout that you seamlessly mount partitions to so they become part of this single root file system.

I just thought it strange you can have /tmp as sda2: and /home as sda3:, but NOT /tmp as sda2:tmp and /home as sda2:home. My thinking is a link is a link, so why is one allowed and the other not? It seems a mount point has to have root access to a partition and can't be pointing to a folder/directory on the partition.

In Windows, we tend to move folders outwards to different locations by using separate drive letters and paths in the registry. In Linux, it seems we move root partitions to the "file system".
 
Last edited:
/edit - I suppose I should say that what I'm doing isn't the normal thing that is done, hence the difficulty finding other people doing it. I've got some SSD love and want to move things that do lots of small file writing, incremental updating and alike onto an HDD.


I don't think there is any way to do this kind of thing during installation.

I was planning to move my /tmp, /var and have a /scratch area on a single partition though I've not got round to doing it yet as Ubuntu has some weirdness if trying to move /var onto a non root partition.

Here is the rough procedure I used for /scratch.
Code:
mkdir /mnt/tempstorage

mount /dev/sda1 /mnt/tempstorage

mkdir /mnt/tempstorage/scratch

ln -s /mnt/tempstorage/scratch/ /scratch

Now if sda1 is unmounted scratch doesn't exist otherwise I get a /scratch in the root folder.

There is a detailed guide on moving multiple folders to a single partition including how to migrate data >here<.

From my bookmarks:
A thread off the Ubuntu forums talking about moving /var.

Using fstab rather than symbolic links. I was planning to try this as it will be neater having everything in one place.
 
Last edited:
Thanks for the advice Fourstar and the rest of you guys.

I just wanted to know what is and isn't possible.

I'll have a read and play around with moving some mount points.
 
Just using straight partitioning a partition can only have a single mount point, i.e. in the example given sda3 can either be /tmp or /home, not both.

This is why on modern linux distributions is best to make use of Logical Volume Manager (LVM). Lets say you have a SSD (sda) and a HD (sdb).

Code:
[FONT=Courier New]sda
sda1: ~250MB /boot
sda2:        /[/FONT]

[FONT=Courier New]sdb
sdb1: LVM "physical volume" large enough for the below 
      (off the top of my head partition type is 8e)[/FONT]
The LVM "physical volume" is added to a volume group volgroup01 and has the following logical volumes created within it:

Code:
[FONT=Courier New]swaplv      swap
tmplv       /tmp
homelv      /home[/FONT]
of what size you want as long as they fit within the sdb1 partition. The logical volumes are not partitions in the traditional sense and allow the divvying up of space within a partition to separate filesystems. The other bonus of this is that you can add multiple disks into a volume group and then have filesystems which are larger than a single disk easily (and this growth can be done with this system up and running).

RHEL/CentOS and SLES/OpenSUSE allow you to configure LVM during the install. Ubuntu used to require the use of the alternate install CD if you were using LVM ... I don't know if this is still the same at 10.10. For other distributions YMMV.

At work we tend to use something along the following lines

Code:
[FONT=Courier New]sda1: 102MB /boot
sda2: (Rest of Disk) LVM PV

SystemVG (made with LVM PV)[/FONT] [FONT=Courier New]
rootLV      /
swap        swap
tmpLV       /tmp
varLV       /var
homeLV      /home[/FONT]
Any other applications/data go onto other disks in other LVM volume groups.
 
I would echo memyselfandi with lvm lvs.

I tend to think of vg (volume groups) as a JBOD array (just a collection of hard drives grouped to give one big chunk of space).

You can then create a logical volume on that vg and grow / shrink it as the need arises by adding another disk.

With mounting and linking you still run the risk of running out of space and then having to migrate on to a bigger disk.

RB
 
Right lads, gentoo handbook time http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8

This covers the area we are all beating about, the fstab (file system table, not f-stab as i like to read it).

Basically you can get away with just having a / partition and a swap partition as the simplest setup, but you can also set each an any folder to be in different places if you wish (the fstab is the base systems way for placing it all). In the gentoo way its good to have a boot folder to keep it neat and not loose different kernels (stability here) and only visible on boot as thats when its needed.

Things like /home are a pretty cool thing to move if you need access or security for it, but be careful of making it to small... Temp apparently is helpful to move (cant remember why), swap is fun to wang on a separate hard drive (back in the day of terrible hdd performance) and /usr was good for security of the system I think (its been a while since i set up linux)
 
Erm, we haven't been beating around anything ... the fstab file is the way you configure the system to link logical volumes, or partitions, with mount point directories if you are moving away from a single monolithic filesystem, (although even then that filesytem will be defined in the fstab file). That's Unix/Linux 101.

Personally, I would not put /usr as a separate partition in this instance; it's an unnecessary complication which would not give any benefit. I would also keep /boot mounted as, whilst it is only needed during the boot process, doing so would just complicate kernel patching or GRUB configuration again for little benefit.
 
Right lads, gentoo handbook time http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8

This covers the area we are all beating about, the fstab (file system table, not f-stab as i like to read it).

Basically you can ....

Guess it depends on what the OP wants. If the aim is to make it so a second HDD can be used as a buffer for tmp and home areas as the primary HDD / is mounted on is getting filled up then as memyselfandi has said, LVM would seem like a good way to mount and manage the problem.

If they are trying to stop the system from pancaking due to the lack of space in certain areas then the same holds true with LVM but just have seperate LVs for /tmp /var and home (to name but three). Can take a look here, or here (scrool down too Securing & Optimizing Linux: The Ultimate Solution and look under installation for partition / mount point recommendations).

If the home area is filling up and you don't want it to expand then you could always look at implementing quotas.

RB
 
Back
Top Bottom