Author Topic: Mount USB hard drive at boot time  (Read 1656 times)

gnerdman

  • Guest
Mount USB hard drive at boot time
« on: June 16, 2010, 08:55:30 PM »
I've been a Linux user for years and I've never encountered this issue (although this is my first exposure to PCLOS). All I want to do is mount an external USB hard drive on a specific directory at boot time. In other distros, all I had to do was add an entry to /etc/fstab thusly:

UUID=83483438-5135-4724-9d1c-6c6811043506 /usbdrv ext3 defaults 1 2

I verified the blkid:

# blkid /dev/sdc1
/dev/sdc1: UUID="83483438-5135-4724-9d1c-6c6811043506" SEC_TYPE="ext2" TYPE="ext3"

I know that's the right device because this is the only drive attached to the system that's ext3. I've never seen an fstab entry not work. What am I doing wrong? Surely I don't have to hand-hack udev rules, right? Thanks in advance.

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5381
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Mount USB hard drive at boot time
« Reply #1 on: June 16, 2010, 09:27:07 PM »
I go into PCC --> Local Disks  I click on the drive I want and on the partition and than tell it the mount point and than click on mount. When I click on "DONE" it pops up asking if I want to save to the fstab and I say yes/ok.  After that it mounts each time I boot the system.  Hope it help you out.




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Mount USB hard drive at boot time
« Reply #2 on: June 16, 2010, 10:18:40 PM »
I've been a Linux user for years and I've never encountered this issue (although this is my first exposure to PCLOS). All I want to do is mount an external USB hard drive on a specific directory at boot time. In other distros, all I had to do was add an entry to /etc/fstab thusly:

UUID=83483438-5135-4724-9d1c-6c6811043506 /usbdrv ext3 defaults 1 2

I verified the blkid:

# blkid /dev/sdc1
/dev/sdc1: UUID="83483438-5135-4724-9d1c-6c6811043506" SEC_TYPE="ext2" TYPE="ext3"

I know that's the right device because this is the only drive attached to the system that's ext3. I've never seen an fstab entry not work. What am I doing wrong? Surely I don't have to hand-hack udev rules, right? Thanks in advance.

Did you, as root, create the mount point directory /usbdrv?
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

gnerdman

  • Guest
Re: Mount USB hard drive at boot time
« Reply #3 on: June 17, 2010, 02:31:55 AM »
I go into PCC --> Local Disks  I click on the drive I want and on the partition and than tell it the mount point and than click on mount. When I click on "DONE" it pops up asking if I want to save to the fstab and I say yes/ok.  After that it mounts each time I boot the system.  Hope it help you out.


Thanks YouCanToo, I removed my own fstab entry, went into the hard disk tool, and followed your directions. I mounted up and saved the new fstab entry, but when I rebooted the drive didn't mount - status quo.

gnerdman

  • Guest
Re: Mount USB hard drive at boot time
« Reply #4 on: June 17, 2010, 02:34:58 AM »
Did you, as root, create the mount point directory /usbdrv?

Yes, I created the mount point when I set it up - I can mount/umount it manually all day. However, the mount point is owned by my uid/gid, since I want to be able to write to it as "myself". It just refuses to mount on boot.
« Last Edit: June 17, 2010, 03:16:28 AM by old-polack »

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Mount USB hard drive at boot time
« Reply #5 on: June 17, 2010, 03:42:47 AM »
Did you, as root, create the mount point directory /usbdrv?

Yes, I created the mount point when I set it up - I can mount/umount it manually all day. However, the mount point is owned by my uid/gid, since I want to be able to write to it as "myself". It just refuses to mount on boot.

All of these currently auto mount at boot;
Code: [Select]
LABEL=TR5-Documents     /home/polack/Documents  ext3    defaults,noatime                1 2
LABEL=Documents2        /home/polack/Documents2 ext3    defaults,noatime                1 2
LABEL=share7            /share7                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec,noatime       0 0
LABEL=TV-1              /tv                     ext3    rw,user,auto,exec,noatime       0 0

while these are user mountable/unmountable at will.
Code: [Select]
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec,noatime     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec,noatime     0 0
LABEL=boot200           /mnt/boot               ext3    rw,user,noauto,exec,noatime     0 0
LABEL=part17            /mnt/17                 ext4    rw,user,noauto,exec,noatime     0 0

Those in the first group were originally user mountable, but I removed the no from noauto to have them mount at boot. I have not removed the user from the mount options as there are times when I replace the no to make them user mountable again.

Having the mount option defaults should be enough to have the partition auto mount at boot, but if, for some reason, it does not, rw,auto,exec should work. The noatime is optional.
« Last Edit: June 17, 2010, 11:14:24 AM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

gnerdman

  • Guest
Re: Mount USB hard drive at boot time
« Reply #6 on: June 17, 2010, 04:03:37 AM »
Having the mount option defaults should be enough to have the partition auto mount at boot, but if, for some reason. it does not, rw,auto,exec should work. The noatime is optional.

Here's my new fstab entry:

UUID=83483438-5135-4724-9d1c-6c6811043506 /usbdrv ext3 rw,user,auto,exec,noatime 0 0

It still didn't mount at boot.

I'm beginning to wonder if there's something wrong with startup stuff in general. I set up update-notifier to autostart when kde comes up, but it fails too. It gives me the message that my network connection is up, but it couldn't contact the repository. It then asks me if I want to configure a new repository. If I say "no" and start it from the menu, it starts up fine.
« Last Edit: June 17, 2010, 11:16:40 AM by old-polack »

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Mount USB hard drive at boot time
« Reply #7 on: June 17, 2010, 11:19:26 AM »
Having the mount option defaults should be enough to have the partition auto mount at boot, but if, for some reason. it does not, rw,auto,exec should work. The noatime is optional.

Here's my new fstab entry:

UUID=83483438-5135-4724-9d1c-6c6811043506 /usbdrv ext3 rw,user,auto,exec,noatime 0 0

It still didn't mount at boot.

I'm beginning to wonder if there's something wrong with startup stuff in general. I set up update-notifier to autostart when kde comes up, but it fails too. It gives me the message that my network connection is up, but it couldn't contact the repository. It then asks me if I want to configure a new repository. If I say "no" and start it from the menu, it starts up fine.

What does the command mount by itself give you?

[polack@littleboy ~]$ mount
/dev/sdc15 on / type ext4 (rw,noatime)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=0620)
/dev/sdc5 on /home/polack/Documents type ext3 (rw,noatime)
/dev/sde5 on /home/polack/Documents2 type ext3 (rw,noatime)
/dev/sdb6 on /share7 type ext3 (rw,nosuid,nodev,noatime)
/dev/sde6 on /share9 type ext3 (rw,nosuid,nodev,noatime)
/dev/sde9 on /movies type ext3 (rw,nosuid,nodev,noatime)
/dev/sdc12 on /movies2 type ext3 (rw,nosuid,nodev,noatime)
/dev/sda5 on /tv type ext3 (rw,nosuid,nodev,noatime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sr1 on /mnt/dvd type iso9660 (ro,noexec,nosuid,nodev,user=polack)
« Last Edit: June 17, 2010, 11:23:19 AM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

gnerdman

  • Guest
Re: Mount USB hard drive at boot time
« Reply #8 on: June 17, 2010, 03:49:12 PM »

What does the command mount by itself give you?

[polack@littleboy ~]$ mount
/dev/sdc15 on / type ext4 (rw,noatime)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=0620)
/dev/sdc5 on /home/polack/Documents type ext3 (rw,noatime)
/dev/sde5 on /home/polack/Documents2 type ext3 (rw,noatime)
/dev/sdb6 on /share7 type ext3 (rw,nosuid,nodev,noatime)
/dev/sde6 on /share9 type ext3 (rw,nosuid,nodev,noatime)
/dev/sde9 on /movies type ext3 (rw,nosuid,nodev,noatime)
/dev/sdc12 on /movies2 type ext3 (rw,nosuid,nodev,noatime)
/dev/sda5 on /tv type ext3 (rw,nosuid,nodev,noatime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sr1 on /mnt/dvd type iso9660 (ro,noexec,nosuid,nodev,user=polack)


Just the partitions on the internal drive:

/dev/sda6 on / type ext4 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/sda1 on /boot type ext4 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/proc on /var/lib/named/proc type none (ro,bind)

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Mount USB hard drive at boot time
« Reply #9 on: June 17, 2010, 04:10:27 PM »

What does the command mount by itself give you?

[polack@littleboy ~]$ mount
/dev/sdc15 on / type ext4 (rw,noatime)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=0620)
/dev/sdc5 on /home/polack/Documents type ext3 (rw,noatime)
/dev/sde5 on /home/polack/Documents2 type ext3 (rw,noatime)
/dev/sdb6 on /share7 type ext3 (rw,nosuid,nodev,noatime)
/dev/sde6 on /share9 type ext3 (rw,nosuid,nodev,noatime)
/dev/sde9 on /movies type ext3 (rw,nosuid,nodev,noatime)
/dev/sdc12 on /movies2 type ext3 (rw,nosuid,nodev,noatime)
/dev/sda5 on /tv type ext3 (rw,nosuid,nodev,noatime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sr1 on /mnt/dvd type iso9660 (ro,noexec,nosuid,nodev,user=polack)


Just the partitions on the internal drive:

/dev/sda6 on / type ext4 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/sda1 on /boot type ext4 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/proc on /var/lib/named/proc type none (ro,bind)


I hate to ask the blatantly obvious, but is the power turned on for the external drive? Most of the partitions I listed, those on /dev/sdc and /dev/sde, are on external hard drives, and all mount as desired and listed in /etc/fstab.

Only two of the partitions listed in /etc/fstab are on internal hard drives. They auto mount as well.
« Last Edit: June 17, 2010, 04:12:12 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

gnerdman

  • Guest
Re: Mount USB hard drive at boot time
« Reply #10 on: June 17, 2010, 05:13:42 PM »
I hate to ask the blatantly obvious, but is the power turned on for the external drive? Most of the partitions I listed, those on /dev/sdc and /dev/sde, are on external hard drives, and all mount as desired and listed in /etc/fstab.

Only two of the partitions listed in /etc/fstab are on internal hard drives. They auto mount as well.

Yes, it's on. I can manually mount and umount the drive at will after the system boots. It just won't automount at boot time.

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Mount USB hard drive at boot time
« Reply #11 on: June 17, 2010, 05:25:40 PM »
I hate to ask the blatantly obvious, but is the power turned on for the external drive? Most of the partitions I listed, those on /dev/sdc and /dev/sde, are on external hard drives, and all mount as desired and listed in /etc/fstab.

Only two of the partitions listed in /etc/fstab are on internal hard drives. They auto mount as well.

Yes, it's on. I can manually mount and umount the drive at will after the system boots. It just won't automount at boot time.


First let's see the results of;

[root@localhost ~]# cat /etc/fstab                        <Enter>

then;

[root@localhost ~]# mount -a                        <Enter>

and last;

[root@localhost ~]# mount                        <Enter>

in that order. Include the prompt and command with the results. (copy/paste)
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

gnerdman

  • Guest
Re: Mount USB hard drive at boot time
« Reply #12 on: June 18, 2010, 03:02:29 AM »
Yes, it's on. I can manually mount and umount the drive at will after the system boots. It just won't automount at boot time.


First let's see the results of;

[root@localhost ~]# cat /etc/fstab                        <Enter>

[root@serenity ~]# cat /etc/fstab
# Entry for /dev/sda6 :
UUID=1dc3bf04-1f71-4f84-a3a0-0d1e8b5d263d / ext4 defaults 1 1
# Entry for /dev/sda1 :
UUID=e1f752cc-ebdf-4afb-b203-65e3b7963e64 /boot ext4 defaults 1 2
none /dev/pts devpts defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=5c0fd807-2c29-4ec9-bc84-ffcc8d8bf2b1 swap swap defaults 0 0
# Entry for /dev/sdc1 :
UUID=83483438-5135-4724-9d1c-6c6811043506 /usbdrv ext3 rw,auto,dev,noatime,exec 0 0

then;

[root@localhost ~]# mount -a                        <Enter>[root@serenity ~]



First, mount without the -a argument:

# mount
/dev/sda6 on / type ext4 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/sda1 on /boot type ext4 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/proc on /var/lib/named/proc type none (ro,bind)

Now, mount -a:

[root@serenity ~]# mount -a

and last;

[root@localhost ~]# mount                        <Enter>

[root@serenity ~]# mount
/dev/sda6 on / type ext4 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/sda1 on /boot type ext4 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/proc on /var/lib/named/proc type none (ro,bind)
/dev/sdc1 on /usbdrv type ext3 (rw,noatime)

in that order. Include the prompt and command with the results. (copy/paste)

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Mount USB hard drive at boot time
« Reply #13 on: June 18, 2010, 04:42:32 AM »
gnerdman:

As mount -a has the desired effect, as root, enter that on it's own line at the end of /etc/rc.d/rc.local, press Enter to start a new line, then save the file.

Reboot, and all auto mount partitions will be.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

gnerdman

  • Guest
Re: Mount USB hard drive at boot time
« Reply #14 on: June 18, 2010, 08:37:52 PM »
gnerdman:

As mount -a has the desired effect, as root, enter that on it's own line at the end of /etc/rc.d/rc.local, press Enter to start a new line, then save the file.

Reboot, and all auto mount partitions will be.

That worked. I'm moderately annoyed that fstab doesn't, but a couple of days from now I'll forget all about it until I need it again.  :)  Thanks for hanging in there, old-polack, I really appreciate your efforts!