7

I've installed raspbmc, but from what I've seen it's based on raspbian, so this might go for raspbian too.

I've connected a USB hard-drive. Most of the time, it will be automatically mounted on /media/usb0, to which /media/usb is a symlink.

My problem is in that most. What is the best way to have the drive mounted at boot at the same mountpoint?

I did some looking around. Can I use /dev/disk/by-label in /etc/fstab or will that clash with the automatic mounting, which sometimes doesn't work?

2
  • Hi Chris. Mount by label or uuid should work fine, however it means it will only mount at boot. Is that what you want?
    – Jivings
    Oct 20, 2012 at 15:49
  • I want it to at least be mounted at boot. Right now sometimes it won't get mounted. And reconnecting it might mount it at /media/usb1, invalidating all media paths stored in the database. Oct 22, 2012 at 6:22

3 Answers 3

3

I use /dev/disk/by-id without any issues, so I suggest you use that.

1
  • This is the best way. These links are updated by udev upon detecting devices.
    – Nakedible
    Oct 29, 2012 at 11:04
1

Just for completeness: In 2021, you would typically use the PARTUUID from $ blkid /dev/sdx. Then the /etc/fstab line would start with PARTUUID=xxxxxxxx-yy.

1

On Raspbian, automount no longer mounts USB drives as /media/usbx by default since at least 4 years now, probably more. You get them mounted as /media/user/disk_label now, which is also reliable, unless you have a habit of giving the same label to several disks. If you don't label your disks, you'll get /media/user/UUID, which is also reliable, but not really user-friendly.

If you have more than 1 disk, configuring automount will save you time and frustration compared to manually editing /etc/fstab every time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.