LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can I mount two folders to one partition? (https://www.linuxquestions.org/questions/linux-newbie-8/can-i-mount-two-folders-to-one-partition-426635/)

gckaibab 03-20-2006 11:38 AM

Can I mount one partition to two folders?
 
Would I be able to mount the same drive (partition) to 2 folders?
like for example:
mount hdx(#) to /home and /usr at the same time so that they both use the same partition

acid_kewpie 03-20-2006 12:39 PM

you want the contents of /home to be the same as the contents of /usr ???? how does that make any sense?? if you mean you want to store the data seperately in different locations in that partition, you could just use a symlink from, say, /home to /usr/home or something... not nice at all though.

jeelliso 03-20-2006 12:40 PM

Yes you can, but I don't see why you would ever need to.

gckaibab 03-20-2006 12:53 PM

Quote:

Originally Posted by acid_kewpie
you want the contents of /home to be the same as the contents of /usr ???? how does that make any sense?? if you mean you want to store the data seperately in different locations in that partition, you could just use a symlink from, say, /home to /usr/home or something... not nice at all though.

I was just using it as an example to show you what i meant as far as the question was concerning. By the way, how do you symlink? (I know it stands for: symbolic link, and I have run across it when I tried BeOS.)
And I also have another question:

Also is it a good idea to put /root onto it's own partition (or not)?

jeelliso 03-20-2006 12:55 PM

A simlink is kind of like a shortcut. You can make them using "ln -s." Check the man page and info page for more details.

There's really no need to put /root on its own partition, its not used much normally anyways.

gckaibab 03-20-2006 01:03 PM

I am just wanting to keep the /root config files (/root/.(whateverprogamthisis)) out of the "/" partition (which will be about a 1G partition)
And also thanks for your help.

jeelliso 03-20-2006 01:13 PM

Are you only making the partition that you will mount "/" 1G? This will not be enough room unless you are running a very low lever system, like a router. Most everything goes in "/", so you will need to make this partition much bigger. I don't know you situation though, so if you know what your doing, you can just ignore my comments.

haertig 03-20-2006 04:12 PM

Quote:

Originally Posted by jeelliso
Are you only making the partition that you will mount "/" 1G? This will not be enough room unless you are running a very low lever system, like a router.

That's actually quite a bit of room for / based on what I've run into. I'm currently only using 140Mb of the 1Gb I allocated to my / partition (Note: I have all my other major filesystems broken out of / and mounted seperately). If you are not breaking out your filesystems into seperate mountpoints then I agree, 1Gb would only handle a very lightweight install.
Code:

$ df
Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/sda7              918322    141400    727926  17% /
tmpfs                  1037688        0  1037688  0% /dev/shm
/dev/sda5                45130    18196    24526  43% /boot
/dev/mapper/vg0-usr    2445053  1906963    433724  82% /usr
/dev/mapper/vg0-var    1920391    549865  1268126  31% /var
/dev/mapper/vg0-opt    242191    156698    72591  69% /opt
/dev/mapper/vg0-tmp    479842      8289    445953  2% /tmp
/dev/mapper/vg0-home    49893    33304    13927  71% /home
/dev/sda1            40957684  6762188  34195496  17% /mnt/windows/c
/dev/sda2            40965748  5927340  35038408  15% /mnt/windows/d
/dev/sda3            30709296  16094384  14614912  53% /mnt/windows/e
tmpfs                    10240      2828      7412  28% /dev
$


pixellany 03-20-2006 05:56 PM

I would never advocate anything this complex--mostly because I project myself into the picture and know that **I** woudl not be able to keep track of what is going on.

Do you get a performance benefit in your scheme?

Electro 03-20-2006 06:39 PM

There is the bind option while mounting another directory to a certain directory that is already mounted. For an example, you could use bind for /tmp and /var/tmp on /dev/shm to increase performance. Another example is when you want a directory to share the same directory with out using symbolic links on a SAMBA server. There are other mount options.


The correct term is directory not folders. This goes the same for Windows too.

Charred 03-20-2006 08:44 PM

This seems needlessly complex.

The more complex it is, the easier it'll break, and the nastier it is to fix when it does.

Keep it simple.

haertig 03-20-2006 10:35 PM

Quote:

Originally Posted by pixellany
Do you get a performance benefit in your scheme?

I highly doubt it. I set things up in a complex way because I like to learn through experience. Is it necessary to have all seperate mountpoints and three LVM volume groups like on my home system (below)? Of course not. It's ludicrous. But I learn by doing, and so I did this to learn. I also take LVM snapshots to do my backups. Again, not necessary for a home system, but a good way to learn. If that makes any sense?!

Quote:

Originally Posted by Charred
This seems needlessly complex.

Ahh, shucks ... that is my simple system! :rolleyes: My more complex one is at home:
Code:

# df
Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/hda8              293555    100529    177365  37% /
tmpfs                  518256        0    518256  0% /dev/shm
/dev/hda9                30075      4648    23823  17% /boot
/dev/mapper/vg_linux-home
                        100269    57250    38760  60% /home
/dev/mapper/vg_linux-opt
                        628411    469893    138489  78% /opt
/dev/mapper/vg_linux-tmp
                        95952      4145    86687  5% /tmp
/dev/mapper/vg_linux-usr
                      2925148  2548843    282671  91% /usr
/dev/mapper/vg_linux-var
                      1462324    487861    912040  35% /var
/dev/mapper/vg_myth-recordings
                    165933916  62219780 103714136  38% /opt/mythtv/recordings
tmpfs                    10240      160    10080  2% /dev
/dev/mapper/vg_backup-backup
                      9611492  6635580  2487672  73% /mnt/backup
//192.168.0.51/c      40956928  17103872  23853056  42% /mnt/bedroom/c
//192.168.0.51/f      58781696  52674560  6107136  90% /mnt/bedroom/f
//192.168.0.51/h      44122112  27951104  16171008  64% /mnt/bedroom/h
//192.168.0.53/c    117153792  77705216  39448576  67% /mnt/livingroom/c
/dev/hda2              6144860  5982628    162232  98% /mnt/familyroom/c
/dev/hda1              272524    74092    198432  28% /mnt/familyroom/d
#



All times are GMT -5. The time now is 06:57 PM.