Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Automount partitions Ubuntu 10.x

  1. #1
    Join Date
    Dec 2007
    Location
    USA
    Beans
    152
    Distro
    Ubuntu 10.04 Lucid Lynx

    Automount partitions Ubuntu 10.x

    I usually partition my hard drives with at least 3 partitions- /, swap and a data storage partition I usually disklabel "Data", usually formatted to ext3/4

    When you install and boot Ubuntu 10.x, the Data partition shows up in Places>removable Media, and also in standard Gnome File selector dialogs, but Data is not mounted until you click on it in one of these two places.

    I do not want to manually edit fstab nor enter the user account password everytime to mount it, as would be required using the 'mount' command in a terminal (I.e. sudo mount).

    All I want is the equivalent of using the mouse pick Places> Removable Media> Data, which mounts the Data partition without asking for the user account password, automatically mounting to /media/Data, WITHOUT requiring the directory /media/Data to be created or existing prior to picking the partition in Places> Removable Media> Data.

    What is the equivalent terminal command to do the same thing as the mouse pick? Again- NO sudo/password needed, and automatically creating a mountpoint in /media using the disklabel of the partition?

    I want the Data partition to be automounted using its disklabel everytime I boot, WITHOUT a password or manual fstab editing, simply behaving as if I clicked Places>Removable Media>Data.

    Some quick googling turned up

    https://help.ubuntu.com/community/Au...ountPartitions

    but the gnome-mount command appears obsoleted in Ubuntu 10.x, and I tried variations of the mount command

    http://manpages.ubuntu.com/manpages/...8/mount.8.html

    but couldn't come up with the secret sauce to replicate the simple mouse pick Places>Removable Media>Data (or picking Data in a stock file selector).

    What method or command does Ubuntu use to mount the Data partition when it is mouse clicked via Places>Removable Media>Data?
    Last edited by rgb1701; March 23rd, 2011 at 12:18 PM.

  2. #2
    Join Date
    Dec 2010
    Location
    Something witty.
    Beans
    204
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Automount partitions Ubuntu 10.x

    You can dump this into a script and have it run on boot (or run this command from a terminal, I'll provide both "versions").

    Code:
    #!/bin/sh
     
    if [ ! -d /media/Data ]; then
         mkdir /media/Data
    fi
     
    mount -t ext3 /dev/sdb1 /media/Data
    Of course, change /dev/sdb1 to whatever partition and disk data actually resides on. If you want to run that all as one command from a terminal, type:

    Code:
    if [ ! -d /media/Data ]; then mkdir /media/Data; fi; mount -t ext3 /dev/sdb1 /media/Data

  3. #3
    Join Date
    Jun 2010
    Location
    Ambala , Haryana, India
    Beans
    124
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Automount partitions Ubuntu 10.x

    sudo apt-get install mountmanager
    and then, then use it to automount all types of partitions.
    For Ubuntu basics :-> www.linoob.com

    Ubuntu User #31222

  4. #4
    Join Date
    Dec 2007
    Location
    USA
    Beans
    152
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Automount partitions Ubuntu 10.x

    Quote Originally Posted by blind2314 View Post
    You can dump this into a script and have it run on boot (or run this command from a terminal, I'll provide both "versions").

    Code:
    #!/bin/sh
     
    if [ ! -d /media/Data ]; then
         mkdir /media/Data
    fi
     
    mount -t ext3 /dev/sdb1 /media/Data
    Of course, change /dev/sdb1 to whatever partition and disk data actually resides on. If you want to run that all as one command from a terminal, type:

    Code:
    if [ ! -d /media/Data ]; then mkdir /media/Data; fi; mount -t ext3 /dev/sdb1 /media/Data
    Thanks, but your method requires creating the directory /media/Data, which most likely requires a sudo command and password.

    Isn't there a terminal command that replicates the functionality of simply mouse picking Places>Removable Media>Data? This means automatically mounting the Data partition to /media WITHOUT the a priori creattion of a /media/Data directory, creating the mountpoint /media/Data automatically based on the disklabel (Data in this case).

    /rant on
    I never understood why this is so difficult and/or obfuscated, particularly in Ubuntu (whose raison de'etre is usability for normal non-CS/sysadmin users) in 2011.

    I understand the CS/sysadmin security reasons for partition mount policies, but there is ZERO reason to NOT automount all recognized partitions at first startup, just like Windows does with all formatted partitions, assigning drive letters to all recognized partitions. The analogous Ubuntu/linux behavior ought to be simply mounting all recognized/formatted partitions physically attached to the computer to /media, the same as mouse picking them in the Places menu.

    If inserted USB sticks and hard drives are automounted, then why aren't partitions INSIDE THE COMPUTER!?

    At minimum, the behavior is consistent, and an annoyance to noobs and those who setup installs for others.
    /rant off
    Last edited by rgb1701; March 23rd, 2011 at 03:47 PM.

  5. #5
    Join Date
    Dec 2007
    Location
    USA
    Beans
    152
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Automount partitions Ubuntu 10.x

    Quote Originally Posted by celldweller1591 View Post
    and then, then use it to automount all types of partitions.
    Thanks- I'll try it later. I assume I won't need to create the directory /media/Data prior to using it...

  6. #6
    Join Date
    Dec 2010
    Location
    Something witty.
    Beans
    204
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Automount partitions Ubuntu 10.x

    Quote Originally Posted by rgb1701 View Post
    Thanks, but your method requires creating the directory /media/Data, which most likely requires a sudo command and password.

    Isn't there a terminal command that replicates the functionality of simply mouse picking Places>Removable Media>Data? This means automatically mounting the Data partition to /media WITHOUT the a priori creattion of a /media/Data directory, creating the mountpoint /media/Data automatically based on the disklabel (Data in this case).

    /rant on
    I never understood why this is so difficult and/or obfuscated, particularly in Ubuntu (whose raison de'etre is usubility for normal mom-CS/sysadmin users) in 2011.

    I understand the CS/sysadmin security reasons for partition mount policies, but there is ZERO reason to NOT automount all recognized partitions at first startup, just like Windows does with all formatted partitions, assigning drive letters to all recognized partitions. The analogous Ubuntu/linux behavior ought to be simply mounting all recognized/formatted partitions physically attached to the computer to /media, the same as mouse picking them in the Places menu.

    If inserted USB sticks and hard drives are automounted, then why aren't partitions INSIDE THE COMPUTER!?

    At minimum, the behavior is consistent, and an annoyance to noobs and those who setup installs for others.
    /rant off

    There are actually good reasons to not automount every single recognized partition at boot (unless it's in your fstab). I'm sorry that you're having difficulties, but ranting about downfalls in an OS that are there for a purpose isn't really useful to anyone.

    Also, for what it's worth, the reason Windows automounts everything is because it does make changes to its partition/filesystem table when new partitions are created..the user doesn't have a say in this.

  7. #7
    Join Date
    Dec 2009
    Beans
    5,831

    Re: Automount partitions Ubuntu 10.x

    But mountmanger will create entries in fstab which violates one of your original requirements.

    What is your objection to having entries in fstab or creating your own mount points. None of my business I suppose - just like to know.

  8. #8
    Join Date
    Dec 2007
    Location
    USA
    Beans
    152
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Automount partitions Ubuntu 10.x

    Quote Originally Posted by Morbius1 View Post
    But mountmanger will create entries in fstab which violates one of your original requirements.

    What is your objection to having entries in fstab or creating your own mount points. None of my business I suppose - just like to know.
    No big objection to changing fstab- I just wanted a method that didn't require manual fstab editing or the need for the mountpoint directory to exist already.

    http://opendesktop.org/content/show....?content=78270

    http://www.ubuntugeek.com/mount-mana...artitions.html

    Personally, I have no barrier to editing fstab manually, but I prefer point and click methods, and I need simple GUI methods in order to instruct non-techie types in how to automount partitions.

    Automounting is important for DVR/PVR machines running MythTV, for example. I always set Myth to record to a partition and/or drive separate from the OS / partition. If there is a power failure and the machine restarts (for any reason), the recording partition needs to be there (mounted) at startup. When I tell a non-techie user how to install Mythbuntu with a simple point and click procedure, I need a similarly simple point and click GUI method to let them automount their recording partition/drive.
    Last edited by rgb1701; March 23rd, 2011 at 03:40 PM.

  9. #9
    Join Date
    Dec 2007
    Location
    USA
    Beans
    152
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Automount partitions Ubuntu 10.x

    Quote Originally Posted by blind2314 View Post
    There are actually good reasons to not automount every single recognized partition at boot (unless it's in your fstab). I'm sorry that you're having difficulties, but ranting about downfalls in an OS that are there for a purpose isn't really useful to anyone.

    Also, for what it's worth, the reason Windows automounts everything is because it does make changes to its partition/filesystem table when new partitions are created..the user doesn't have a say in this.
    Apologize for the rantish post, but this has been a pet peeve behavior for a LONG time. Usability issues are typically emotional, and are basic functionality issues with a BIG impact on "normal" non-techie users.

    Ubuntu needs to prompt the user the first time a partition is picked in Places>Removable Media with a simple checkbox that asks "Would you like to mount this partition automatically every time you start?", then ask for the account password if needed once to make the change, automounting that partition to /media/$DISKLABEL just like the manual mouseclick.

    It would still be useful to know the terminal command equivalent to the Places>Removable Media mouse click, i.e. mounting a partiton to /media/$DISKLABEL *without* the directory /media/$DISKLABEL existing already.

    re: Windows partition tables updating-

    Again, if Ubuntu automounts inserted USB drives, which represent a FAR greater security/privacy risk vs partitions on hard disks located physically inside the computer itself, then why aren't the partitions on internal drives automounted (or at minimum, prompted for automounting if desired)?
    Last edited by rgb1701; March 23rd, 2011 at 03:52 PM.

  10. #10
    Join Date
    Dec 2009
    Beans
    5,831

    Re: Automount partitions Ubuntu 10.x

    Then the best thing to do is instruct the installer to have all these non-system disks mount at boot when you do the initial install. The installer will basically ask you two questions:

    Where do you want it to mount?
    How is it currently formatted?

    The installer will do the rest populating fstab with what it thinks is the appropriate setting.

Page 1 of 3 123 LastLast

Tags for this Thread

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
  •