Results 1 to 9 of 9

Thread: [SOLVED] Mounting confusion

  1. #1
    Join Date
    Apr 2008
    Location
    UK
    Beans
    251
    Distro
    Ubuntu 10.04 Lucid Lynx

    [SOLVED] Mounting confusion



    Perhaps someone can explain to me... I have a Linux box at work, its not a ubuntu box, its actually a red hat one, but its still linux (so hope its ok to ask here). Anyway, I had some files in /home/user which was mounted on /dev/hda1. I added a shared folder under /opt/shared but the /opt partition was too small, heres what it looked like using the output of "df -h";

    Code:
    /dev/hda1             428G  200G  207G  50% /home
    /dev/hda2              31G  484M   29G   2% /opt
    So i mounted the shared folder onto the hda1 partition using the command;

    Code:
    mount /dev/hda1 /opt/shared/
    So the output of df -h looked like this;

    Code:
    /dev/hda1             428G  200G  207G  50% /home
    /dev/hda2              31G  484M   29G   2% /opt
    /dev/hda1             428G  200G  207G  50% /opt/shared
    So this is what I wanted, one problem now, any users looking in the /opt/shared folder can also see the contents of the /home folder.

    Now for the dumb question: why is this happening? Im finding understanding mounts a bit confusing. Any recommendations for learning?

  2. #2
    Join Date
    May 2007
    Location
    San Antonio, TEXAS
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Mounting confusion

    Quote Originally Posted by moody_mark View Post


    Perhaps someone can explain to me... I have a Linux box at work, its not a ubuntu box, its actually a red hat one, but its still linux (so hope its ok to ask here). Anyway, I had some files in /home/user which was mounted on /dev/hda1. I added a shared folder under /opt/shared but the /opt partition was too small, heres what it looked like using the output of "df -h";

    Code:
    /dev/hda1             428G  200G  207G  50% /home
    /dev/hda2              31G  484M   29G   2% /opt
    So i mounted the shared folder onto the hda1 partition using the command;

    Code:
    mount /dev/hda1 /opt/shared/
    So the output of df -h looked like this;

    Code:
    /dev/hda1             428G  200G  207G  50% /home
    /dev/hda2              31G  484M   29G   2% /opt
    /dev/hda1             428G  200G  207G  50% /opt/shared
    So this is what I wanted, one problem now, any users looking in the /opt/shared folder can also see the contents of the /home folder.

    Now for the dumb question: why is this happening? Im finding understanding mounts a bit confusing. Any recommendations for learning?
    it is because you had mounted the home folder. Pay attention to the drive you mount.
    use this instead, if you dont want someone to see the home folder as well.
    Code:
    mount /dev/hda2 /opt/shared/
    Our only ignorance is our own intelligence
    Linux Is not Windows | Atheros 5007 Wifi Chipset Hardy (8.04LTS) Install|
    Linux user number 479043 | Ubuntu User number is # 24065

  3. #3
    Join Date
    Apr 2008
    Location
    UK
    Beans
    251
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Mounting confusion

    Quote Originally Posted by k33bz View Post
    it is because you had mounted the home folder. Pay attention to the drive you mount.
    use this instead, if you dont want someone to see the home folder as well.
    Code:
    mount /dev/hda2 /opt/shared/
    Hi, thanks but this is what I intended, as the /dev/hda1 is the bigger "slice" of the same drive. the /opt/shared was already on /dev/hda2 as it is under /opt anyway (thats how i understand it).

    So I guess my question is, if you mount two different parts of the file system on the same partition, will they see each other?

  4. #4
    Join Date
    May 2007
    Location
    San Antonio, TEXAS
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Mounting confusion

    I am not sure I understand what you are trying to do.

    But I can tell you this, If you put in the terminal to mount hda1, then you will mount it with what ever name you give it to mount with. Which is what you have done, mounting hda1 with the name of /opt/shared
    Our only ignorance is our own intelligence
    Linux Is not Windows | Atheros 5007 Wifi Chipset Hardy (8.04LTS) Install|
    Linux user number 479043 | Ubuntu User number is # 24065

  5. #5
    Join Date
    Apr 2008
    Location
    UK
    Beans
    251
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Mounting confusion

    Quote Originally Posted by k33bz View Post
    If you put in the terminal to mount hda1, then you will mount it with what ever name you give it to mount with. Which is what you have done, mounting hda1 with the name of /opt/shared
    I think this is where im confusing myself. Im thinking you that /home contains some files, and then you mount that lot onto a device like /dev/hda1. If I unmount /home and mounted it on another location like /dev/hdb1 for example, I would expect to still see all my home files, but I guess im wrong here?

  6. #6
    Join Date
    Oct 2006
    Location
    Old Europe
    Beans
    859

    Re: Mounting confusion

    I think you have got it exactly backwards as far as mounting is concerned. You mount a partition to a folder, not vice versa. The point is to make the file system on the partition available under a directory.
    So when you did
    Code:
    mount /dev/hda1 /opt/shared/
    you were making the contents of hda1 available under /opt/shared.

  7. #7
    Join Date
    May 2007
    Location
    San Antonio, TEXAS
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Mounting confusion

    ok I get what you are saying now. MMMMMMM,
    What you really want to do is basically provide a shortcut of just the home folder and everything in it, and have that shortcut accessible on a different partition.

    tell you the truth i dont know if that is possible. I know I dont have the knowledge to pull that off. Nor have I heard of that being done.

    Thanks eggdeng that was better put than what I was trying to say
    Our only ignorance is our own intelligence
    Linux Is not Windows | Atheros 5007 Wifi Chipset Hardy (8.04LTS) Install|
    Linux user number 479043 | Ubuntu User number is # 24065

  8. #8
    Join Date
    Apr 2008
    Location
    UK
    Beans
    251
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Mounting confusion

    Ok.... so, im not trying to do anything special, it was that my understanding of mounting was completely back to front.

    Thank you both for your help, and sorry for confusing anyone

  9. #9
    Join Date
    May 2007
    Location
    San Antonio, TEXAS
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [SOLVED] Mounting confusion

    No problem.
    Our only ignorance is our own intelligence
    Linux Is not Windows | Atheros 5007 Wifi Chipset Hardy (8.04LTS) Install|
    Linux user number 479043 | Ubuntu User number is # 24065

Bookmarks

Posting Permissions

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