Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: How do you setup the system so it automatically mounts a drive at startup?

  1. #11
    Join Date
    Jun 2009
    Location
    Little Rock, Arkansas
    Beans
    190
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do you setup the system so it automatically mounts a drive at startup?

    I can mount the drive manually with a command from bash.
    I can mount it manually from nautilus too.
    What I want to do is have the drive mounted automatically at system startup,
    I don't want to to it manually every time I use my Ubuntu system

    Can Mount Manager be used to setup this automatic mount or is it just another tool
    for manually mounting a drive?
    Last edited by Randy Schilling; July 4th, 2012 at 05:41 PM.

  2. #12
    Join Date
    Mar 2011
    Beans
    183

    Re: How do you setup the system so it automatically mounts a drive at startup?

    What I want to do is have the drive mounted automatically at system startup,
    It's pretty easy.

    Make a directory (e.g. /yourmountpoint) wherever you want it; make yourself the owner, and make it read/write-able as you desire.

    Add a line like this to you /etc/fstab file:
    UUID=whatever /yourmountpoint ntfs-3g defaults 0 0

    Look up the UUID with gparted or palimpsest (a LONG number).
    OR use LABEL=whatever instead of UUID (this might be the easies way)
    OR use /dev/sdwhatever (probably the above two options are better).

    Here's a line from my own fstab:
    LABEL=DATA /data ext4 defaults 0 0
    When the partition was NTFS, the only diff was "ntfs-eg" rather than "ext4". The "DATA" partition is mounted on directory /data after boot.

    It's really nice to LABEL the partitions...you can do it in Windows or with gparted or palimpsest. They have to be unmounted first, which you can do there.

    Then the NTFS file system will be mounted to /yourmoutpoint after you boot.

    Edit: some people say UUID is preferable to LABEL, but either one can cause trouble since you can have two partitions with the same LABEL or with the same UUID - it's less likely with UUID unless you've been copying partitions with "dd" or something.
    Last edited by flemur13013; July 4th, 2012 at 06:03 PM.

  3. #13
    Join Date
    Jun 2009
    Location
    Little Rock, Arkansas
    Beans
    190
    Distro
    Ubuntu 12.04 Precise Pangolin

    Smile Re: How do you setup the system so it automatically mounts a drive at startup?

    Let me ask the question another way.

    I created a directory /mnt/Windows.
    I added the following command to my /etc/profile file:
    mount -t ntfs /dev/sdb2 /mnt/Windows
    I rebooted. I expected to see all my Windows folders in /mnt/Windows.
    This attempt to have my system mount my Windows drive at system startup fails.
    I'd like to know why, but better, I'd like to know what I should have done.

    If this can be done from Mount Manager then please give details and please try to keep in mind that I'm not nearly as technically skilled as any of you.

    Thanks and many kind regards - Randy

  4. #14
    Join Date
    Jun 2009
    Location
    Little Rock, Arkansas
    Beans
    190
    Distro
    Ubuntu 12.04 Precise Pangolin

    Smile Re: How do you setup the system so it automatically mounts a drive at startup?

    OK flemur. I saw your post AFTER submitting the previous post.
    I'm working on your instructions now. I'll get back to you shortly.
    Thanks thanks thanks!

  5. #15
    Join Date
    Mar 2011
    Beans
    183

    Re: How do you setup the system so it automatically mounts a drive at startup?

    Your fstab line is completely WRONG - you don't put the mount command there, you're just passing parameters.

    mount -t ntfs /dev/sdb2 /mnt/Windows - WRONG!

    The line in /etc/fstab should be something like (I'm assuming you labeled the partition "WINDOWS"):

    LABEL=WINDOWS /mnt/Windows ntfs-3g defaults 0 0

    This won't work unless you've given the partition a label.

    Edit: you'll need the "ntfs-3g" package installed; it should be installed by default, but if you have problems and it complains about not knowing what "ntfs-3g" means:

    $ sudo apt-get install ntfs-3g

    Edit 2:
    /dev/sdb2 /mnt/Windows ntfs-3g defaults 0 0
    should also work (if sdb2 is correct - sometimes these change as you (dis)connect disks, hence using the LABEL or UUID).
    Last edited by flemur13013; July 4th, 2012 at 06:46 PM.

  6. #16
    Join Date
    Jun 2009
    Location
    Little Rock, Arkansas
    Beans
    190
    Distro
    Ubuntu 12.04 Precise Pangolin

    Smile Re: How do you setup the system so it automatically mounts a drive at startup?

    Ok flemur, the instructions of your first post worked just fine.

    I installed gparted and found the UUID of /dev/sdb2.
    I added the following command to /etc/fstab
    UUID=8A467EB6467EA29D /mnt/Windows ntfs-3g defaults 0 0
    I redefined some environment variables of my system, directing them to /mnt/Window.
    (ntfs-3g was already installed)

    Everything is working just fine. Thanks, thanks and thanks again.
    Many kind regards - Randy

  7. #17
    Join Date
    Jun 2009
    Location
    Little Rock, Arkansas
    Beans
    190
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do you setup the system so it automatically mounts a drive at startup?

    Yes - I unmounted the drive then labeled it. It was previously unlabeled.

  8. #18
    Join Date
    Apr 2007
    Location
    South Carolina
    Beans
    985
    Distro
    Ubuntu Studio 16.04 Xenial Xerus

    Re: How do you setup the system so it automatically mounts a drive at startup?

    Quote Originally Posted by dcstar View Post
    Do not ever use /media for direct mounts. /media is a system folder for dynamic mounting.

    ..........
    I never heard that before. Can you explain how this could cause a problem?
    Gary

    I wish I knew what I used to know before I knew what I didn't know.

  9. #19
    Join Date
    Dec 2009
    Beans
    6,776

    Re: How do you setup the system so it automatically mounts a drive at startup?

    Quote Originally Posted by garyed View Post
    I never heard that before. Can you explain how this could cause a problem?
    It doesn't.

    Strict UNIX file hierarchy stated that:

    /media = Mount points for removable media such as CD-ROMS, USB, etc..
    /mnt = Temporarily mounted filesystems

    By those definitions you shouldn't be mounting anything other than the OS itself. You could mount it to your own home directory which would be kind of awkward in a multi-user setup. Or you could mount it off / directly which would give old UNIX system administrators a cerebral hemorrhage.

    There is one possibility that could cause a little confusion. Let's say you have a USB storage device labeled "Storage". You also have an internal partition that you mount in fstab to /media/Storage. When that USB device is turned on it is designed to mount to /media/"LABEL-NAME" which in this example would be /media/Storage but there already is a /media/Storage. Roh - Roh. Linux handles this by having the USB device automatically mount to /media/Storage_ ( note the underscore ).
    Last edited by Morbius1; July 4th, 2012 at 08:15 PM.

  10. #20
    Join Date
    Jan 2007
    Beans
    6,537
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How do you setup the system so it automatically mounts a drive at startup?

    Quote Originally Posted by garyed View Post
    I never heard that before. Can you explain how this could cause a problem?
    It doesn't cause a problem, but it does behave differently. It'll show up on your desktop, which may or may not be what you want.

    The mount point doesn't have to be under /mnt either. There's nothing stopping you from creating /banana and mounting stuff there.

Page 2 of 3 FirstFirst 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
  •