LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   1 Mount 2 Folders (https://www.linuxquestions.org/questions/linux-newbie-8/1-mount-2-folders-463468/)

Bishop609 07-12-2006 06:04 PM

1 Mount 2 Folders
 
I have read the threads that somewhat touch on this...but I still must ask, as the situation wasnt quite the same.

1st quarter Linux student here...go easy :)

I created a /archive mountpoint containing my archive when installing Linux

I want to mount that into 2 folders which are

/var/ftp/pub

/archive

I only know how to mount to one of them by modifying the fstab

Can anybody give me the syntax for mounting the one point to both.

It is much appreciated.

leonscape 07-12-2006 06:16 PM

do you know what the actual device is? can you use that, also have you tried just creating two entries bot pointing at the same mountpoint?

pixellany 07-13-2006 08:18 AM

The terminology here can be confusing. Normally, you mount (read "connect") a device to a mount point. The device is described as something like /dev/hdc4 (4th partition on the 3rd HD in a basic IDE bus)

A mount point is normally a folder in the file system. "mount /dev/hdc4 <mountpoint>" means "connect this device to this folder so that I can read the contents by opening the folder"

You can mount a device to two different mountpoints--maybe more. You can NOT mount two different devices to the same mount point.

Once the device is mounted, you can also mount subfolders using the --bind option in mount.

Bishop609 07-13-2006 08:56 AM

Quote:

Originally Posted by leonscape
do you know what the actual device is? can you use that, also have you tried just creating two entries bot pointing at the same mountpoint?

To both,

I appreciate the terminology update...I welcome it...I dont want to sound out of place here.

/achive is a partition

I have noted in the past that when I ran the 'mount' command it would say
this device has already been mounted. (when mounted to one folder)

Are you guys saying that I can add two lines to my fstab, from one partition, pointing to two directories? - and it will do both?

ethics 07-13-2006 09:27 AM

Quote:

Originally Posted by Bishop609
To both,

I appreciate the terminology update...I welcome it...I dont want to sound out of place here.

/achive is a partition

I have noted in the past that when I ran the 'mount' command it would say
this device has already been mounted. (when mounted to one folder)

Are you guys saying that I can add two lines to my fstab, from one partition, pointing to two directories? - and it will do both?

I dont see why it can't work, ofcourse trial and error is great fun ;)

pixellany 07-13-2006 11:29 AM

I'm confused. Partition names are not of the form "/archive". A partition is described in the general form /dev/XdYN
X is typically "h" for IDE/ATAPI, and "s" for SCSI, USB, etc
Y is the letter of the drive: normally #1 is "a", but can be something else if a third-party controller is installed.
N is the number of the partition.

/archive is the name of a file or directory in the root directory. If it is a directory, then it can be used as a mount point.

Sooooo.../archive is not a partition, but it can be the route you take to **get to** a partition.

<<end of semantic nitpick>>

Bishop609 07-13-2006 03:57 PM

Ok here is the answer in case somebody should need to know...

It can be done! Look at my example of the /etc/fstab

LABEL=/ / ext3 defaults 1 1
LABEL=/archive /archive ext3 defaults 1 2
LABEL=/archive /var/ftp/pub ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-hdc6 swap swap defaults 0 0

(We are discussing LABEL=/archive at the top)

All I had to do was put in another line telling it to go somewhere else as well. Using the mount command didnt work, so editing the fstab is the only way I can see to do it... all I can tell you is that it works.

Thanks all around for the help...I have more questions on a differant subject, so I will see you around.

Latez...

Bishop


All times are GMT -5. The time now is 01:48 PM.