Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
hi guys. i have posted a problem on mount before. I got good answers, but then, the more i try the more the questions i get. I tried using a ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13

    mount problem

    hi guys. i have posted a problem on mount before. I got good answers, but then, the more i try the more the questions i get.

    I tried using a mount with out using any options. like

    mount /dev/hda9 /maindir

    and i created a file called file1 in maindir . later on i unmounted the /maindir it had no files in it, when i checked the directory.

    and then i mounted another directory (maindir1) onto hda9. now when i search the directoyr i get file1 in maindir1.

    so its like the file is in hda9 and it gets shown whenever any directory is mounted on it. why is this? and could you guys please direct me to a link where i could read what happens during a mount, like what goes on between the hard-drive, the node numbers?

    thanks

  2. #2
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    and secondly could you just clarify this for me. The very purpose of mount is to

    1) give a directory more room when you feel like its running out of space on the current partition

    2) so that you could assign it acl's.

    would that be it?

    P.S: keep in mind im a newbie!

  3. #3
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    see mounting a hda on any directory is fine, but whatever you do in that dir will actually be stored in the hda.
    Consider this that i mounted a flash drive in the folder flashdir.
    Now whatever files i create are actually getting stored on the flash drive and as soon as i umount the flashdir directory all data in the flashdir will be lost but will remain intact on the flash dirve.

  4. #4
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    well but when i mount other directories to the partition then all the files created by the first one are visible. isnt that not supposed to happen?

  5. #5
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    337
    You don't mount a directory. You mount a disk or a partition.
    If you mount the partition (say hda9) in maindir and create file1, hda9 will always have file1 unless you remove it.
    So when you mount hda9 again you will see file1. The fact that you've mounted it as maindir1 rather than maindir makes no difference.
    Pete

  6. #6
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    yes as peteh said directory can not be mounted only partition can be mounted.

  7. #7
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    ok! so you mount the partition not the directory, thanks! Then, in the redhat certified engineer linux study guide book . there are two points:

    /lib -- Program libraries for the kernel and various command line utilities. Do not mount this directory on a separate partition.

    /dev -- Hardware and software device drivers for everything from floppy drives to terminals. Do not mount this directory on a separate partition.

    Does he mean that i should mount the partition that mounts '/' ? Im not sure if thats the case, because everything will be visible from every directory. What does he mean?

    but you see he also mentions that we shouldnt mount the directory. Hence the confusion.

  8. #8
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    Cool do not doesn't mean can not

    Quote Originally Posted by bioTIN View Post
    ok! so you mount the partition not the directory, thanks! Then, in the redhat certified engineer linux study guide book . there are two points:

    /lib -- Program libraries for the kernel and various command line utilities. Do not mount this directory on a separate partition.

    /dev -- Hardware and software device drivers for everything from floppy drives to terminals. Do not mount this directory on a separate partition.

    Does he mean that i should mount the partition that mounts '/' ? Im not sure if thats the case, because everything will be visible from every directory. What does he mean?

    but you see he also mentions that we shouldnt mount the directory. Hence the confusion.
    that is right my frnd. You should not play with lib but it necessarily doesn't mean that you can not do it. You very well can mount them but it may cause system instability.

    Also can you tell me what is the reason you want to mount one directory onto some other partition because mount is normally used to mount something removable. If you want to create a shortcut or hard copy then use the symblink .

  9. #9
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    337
    You can create a separate partition for your /home / or /usr directories but although you can your manual is suggesting not to do this for /lib etc.
    You have to remember that linux doesn't have drives labelled as C:/, D:/ etc/
    You mount a partition and give it a name and it shows in the file manager just like another directory (or folder).
    So you can mount /home if you have it on a separate partition but you don't mount /Documents (say) which is a directory (or folder) within /home.
    Pete

  10. #10
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    thanks guys and sorry to keep bothering you like this. ONE thing though:

    1) how do i keep two directories on the same partition without each reading the others files? im asking this because if /lib and / were to see each others files, wont that be confusing?

    2) viky mentioned that mounting is temporary, then the partition on / is mounted right?

    sory to be bugging you like this, but some things are confusing, partly because im from windows are recently hv moved over.

    now in widows lets take the case of C and D partitions.

    D: contains two folders folder1 and folder2

    now folder1 and folder2 are comparable to the directories of linux, isnt it? then why in the case of windows dont I see the others files? like why dont i see folder2 files in folder1

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...