Find the answer to your Linux question:
Results 1 to 8 of 8
As is obvious, im a complete newbie. I have this lingering doubt within me. Why mount devices? and what does it achieve? Why cant it be like windows C: D: ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13

    [SOLVED] why mount ?

    As is obvious, im a complete newbie. I have this lingering doubt within me. Why mount devices? and what does it achieve? Why cant it be like windows C: D: etc?

    pardon me for my complete lack of experience. But ill be glad if you could tell me what this is or point me in the right direction.

    thanks.

  2. #2
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by bioTIN View Post
    As is obvious, im a complete newbie. But still i have this lingering doubt within me. Why mount devices? and what does it achieve? Why cant it be like windows C: D: etc?
    I don't understand what you mean. Drive letters in Windows can represent a number of things, including actual wired-in harddrives, separate partitions on those harddrives, removable drives (USB for instance), discs, and even network drives that don't physically exist inside the machine.

    The only reason you don't have to mount your C: and (in some cases) D: drives is that they're already set to automount by the OS. This is true in Linux as well. Your main drive (usually something like /dev/sda) is auto-mounted along with anything else that's listed in your fstab file.

    What precisely are you asking? I'm quite confused.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  3. #3
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    Your right. Let me gather my thoughts. Ill get back as soon as i clear some things for myself. I guess its a case of trying to learn it all, and getting confused.

    thanks.

  4. #4
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    ok. So this is what i had in mind.

    i create a new directory

    mkdir /robin

    now, to mount it and create permissions:

    mount -o acl /dev/hda11 /robin

    now what i dont get is, when we created the /robin directory doesnt it get allocated some space in the physical drive? why are we mounting it again onto hda11?

    I mean to ask, there has to be some space allocated to /robin when it is created. Now is that information transferred to hda11?

    I hope you understand what im trying to get to.

    thanks.

  5. #5
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    I have been working on this for hours, could you direct me to information that will help me understand?

    thanks.

  6. #6
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by bioTIN View Post
    ok. So this is what i had in mind.

    i create a new directory

    mkdir /robin

    now, to mount it and create permissions:

    mount -o acl /dev/hda11 /robin

    now what i dont get is, when we created the /robin directory doesnt it get allocated some space in the physical drive? why are we mounting it again onto hda11?
    I think that you don't understand how the basics of a linux (really any posix OS) file system works.

    We need to start from the beginning.

    In linux there's a single tree, it starts at /. That is also called the root directory. Mounting a disk (or whatever) is nothing else but linking a given directory in your system to that device.

    Usually, you mount one disk at /, however most distros hide this. From there, you can go creating directories and files, they will reside in whatever partition is mounted at /.

    Then, you can mount additional devices at any random directory that already exists. Usually people mount stuff under /mnt/* but it can be any other location. In short, to access a disk you usually need to mount it, link it into a given location on your filesystem. Once a disk is mounted you can just cd into it and use cp, mv, ls or whatever command. So, if you have your cdrom and your pendrive mounted at /mnt/cdrom and /mnt/pendrive, to copy a file from cdrom to the pendrive would be as easy as

    Code:
    cp /mnt/cdrom/myfile /mnt/pendrive/
    In windows, mounting devices is transparent to the user, but it also happens of course. You can't access a drive until the OS has assigned a drive letter to it and is aware of the filesystem that it contains.

    There are many ways to automount stuff in linux as well. Modern desktops will do that for you. There's also ivman, udev rules, and probably many others.

    I mean to ask, there has to be some space allocated to /robin when it is created. Now is that information transferred to hda11?

    I hope you understand what im trying to get to.

    thanks.
    Creating a directory doesn't allocate any space, and mounting a drive on a directory means that the contents of that directory (if any) will be inaccessible while the drive is mounted. The contents of the drive will be shown when you enter that directory instead. Don't worry, whatever was inside the dir that serves as mount point is still there, and will be visible again as soon as you unmount whatever you mounted into that dir.

    Some people see this a bit blurry, overall when coming from any ms OS, but with the time you will get the hang of it if you are really interested in learning. Unfortunately, some desktop environments like to hide these things. I don't like that because people just get confused.

  7. #7
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    I'm not sure what your trying to achieve ?

    mount -o acl /dev/hda11 /robin

    now what i dont get is, when we created the /robin directory doesnt it get allocated some space in the physical drive? why are we mounting it again onto hda11?
    Good question ?

    If you create a directory /robin, it's just like creating a directory robin in c:\ on windows. It can use available space on the root partition ( c: ).

    Unless you want to mount it to another device ( hdd / usb stick ) you don't have to.

    Is there any particular reason you want to use acl's? If you set the permissions on your new directory to 700 ( chmod 700 /robin ) then only the owner of /robin (and root ) will be able to access it.
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  8. #8
    Just Joined!
    Join Date
    Apr 2009
    Posts
    13
    thanks guys. The replies were so detailed! i now understand them a bit. You see the problem was i thought that the physical locations on the hard drive were in the pattern of the file system hierarchy. So stupid of me.

    thanks guys and linux seems to be so great, in that its like lego blocks and we are allowed to build whatever we can. Not the case with MS os.

    thanks again.

Posting Permissions

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