Results 1 to 9 of 9

Thread: mount partition as whole

  1. #1
    Join Date
    May 2011
    Location
    India
    Beans
    94
    Distro
    Ubuntu

    Question mount partition as whole

    Hi there!

    On my system, I have all my data on a separate partition (/dev/sda3) (labelled DATA). Usually I access them by just clicking on them in the file manager. That automatically mounts them. I can see the partition on the /media folder residing as a folder called 'DATA'.

    This time round, I thought I'd try accessing my files from the terminal. I typed in
    "sudo mount /dev/sda3 /media"

    Previously, I remember that when I ran this command (I might be wrong about this), I was able to see the DATA partition residing as a single folder called 'DATA' under '/media'.

    But now, when I run the command, all I see is the subfolders of DATA under the /media folder. I can't see the bigger DATA partition as a whole.

    What is the correct way to do that from the terminal?

  2. #2
    Join Date
    Sep 2009
    Location
    Freiburg/Germany
    Beans
    1,112
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: mount partition as whole

    If you want to mount the disk at /media/DATA you have make sure that the folder /media/DATA exists and use
    Code:
    sudo mount /dev/sda3 /media/DATA
    ClassicMenu Indicator - classic GNOME menu for Unity
    Unsettings - configuration program for the Unity
    Privacy Indicator - easily switch privacy settings in Unity
    Arronax - create and modify app starters

  3. #3
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: mount partition as whole

    diesch is correct, but you may have to create the mount point of /media/DATA first. You have been mounting using the label which is not an automatic mount point when you manually mount it. If you have used /media/DATA as a mount before it may still be in the list of mount.

    If you want to permanently mount it every time your reboot you can add the mount to fstab.

    # mountdisk.txt
    Understanding fstab
    https://help.ubuntu.com/community/Fstab
    Above link was this post before:
    http://ubuntuforums.org/showthread.php?t=283131
    https://help.ubuntu.com/community/Mount/
    https://help.ubuntu.com/community/FilePermissions
    http://www.psychocats.net/ubuntu/mountlinux

    #If you cannot read and write then change the permissions. Not for NTFS
    # Note that the -R is recursion and everything is changed, do NOT run on any system partitions.
    # 777 is read, write & execute by everyone
    I just learned something - see post #8 & 10 by morbius1. Seems like a better way as you have more control over what is executable.
    http://ubuntuforums.org/showthread.php?t=1795369
    sudo chmod 777 /data
    sudo chown $USER:$USER /data
    #where $USER should be your login name
    #or to see user
    echo $USER
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #4
    Join Date
    May 2011
    Location
    India
    Beans
    94
    Distro
    Ubuntu

    Re: mount partition as whole

    Thanks for your replies, guys. But I still have doubts.

    1. I'll rephrase my question this time. When I double click on my 'DATA' partition on Nautilus, it automatically gets mounted on '/media'. I only see it as a folder going by the name 'DATA' (the label of the partition). Now, this double-click must be a substitute for a command which I should be able to run from the terminal. What is that command?

    2. There's another thing I noticed only now. I have a folder called 'GRUBpartition' in my '/media' folder. When I run
    sudo mount /dev/sda3 /media
    that 'GRUBpartition' folder vanishes. Is this normal and why is that?

    Cheers!

  5. #5
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,430
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: mount partition as whole

    Quote Originally Posted by avnd View Post
    why is that?
    Because you keep mounting a different partition over the top of it. Stop mounting it to /media and mount it to /media/Data if you don't want it to cover the other contents of /media.
    None but ourselves can free our minds

  6. #6
    Join Date
    May 2011
    Location
    India
    Beans
    94
    Distro
    Ubuntu

    Re: mount partition as whole

    Quote Originally Posted by avnd View Post

    When I double click on my 'DATA' partition on Nautilus, it automatically gets mounted on '/media'. I only see it as a folder going by the name 'DATA' (the label of the partition). Now, this double-click must be a substitute for a command which I should be able to run from the terminal. What is that command?
    I'm still waiting for an answer for that question. Anyone?

    Cheers!

  7. #7
    Join Date
    Dec 2009
    Beans
    6,776

    Re: mount partition as whole

    Your question has already been answered. Let me try it a different way:

    Quote Originally Posted by avnd View Post
    On my system, I have all my data on a separate partition (/dev/sda3) (labelled DATA). Usually I access them by just clicking on them in the file manager. That automatically mounts them. I can see the partition on the /media folder residing as a folder called 'DATA'.
    What the system will do without you realizing it is this:
    * It creates a mount point at /media/"LABEL of partition"
    * It mounts the partition to that mount point
    * When you unmount it it will remove that mount point

    This time round, I thought I'd try accessing my files from the terminal. I typed in "sudo mount /dev/sda3 /media" ... But now, when I run the command, all I see is the subfolders of DATA under the /media folder. I can't see the bigger DATA partition as a whole.
    It's doing exactly what you told it to do. It's mounting sda3 to /media itself. If you want to recreate what the system will do then recreate it's steps:

    Code:
    sudo mkdir /media/DATA2
    Code:
    sudo mount /dev/sda3 /media/DATA2
    It has to be DATA2 because you are mounting this temporarily. If you create a permanent folder at /media/DATA and then later use the file manager approach to mount it it will mount to /media/DATA_ which will be confusing since you will see both /media/DATA and /media/DATA_.

  8. #8
    Join Date
    Sep 2009
    Location
    Freiburg/Germany
    Beans
    1,112
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: mount partition as whole

    Quote Originally Posted by avnd View Post
    Thanks for your replies, guys. But I still have doubts.

    1. I'll rephrase my question this time. When I double click on my 'DATA' partition on Nautilus, it automatically gets mounted on '/media'. I only see it as a folder going by the name 'DATA' (the label of the partition). Now, this double-click must be a substitute for a command which I should be able to run from the terminal. What is that command?
    Code:
     udisks --mount /dev/sda3
    ClassicMenu Indicator - classic GNOME menu for Unity
    Unsettings - configuration program for the Unity
    Privacy Indicator - easily switch privacy settings in Unity
    Arronax - create and modify app starters

  9. #9
    Join Date
    May 2011
    Location
    India
    Beans
    94
    Distro
    Ubuntu

    Re: mount partition as whole

    Thanks a ton, diesch. It was exactly what I wanted.

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
  •