1

How can I mount every single hard drive connected to a computer (preferably excluding flash drives and CDs) to it's own mount point. For example, if my connected drives looked like so:

DISK                     MEDIA TYPE
/dev/disk0               INTERNAL
    /dev/disk0
    /dev/disk0s1
/dev/disk1               REMOVABLE
    /dev/disk1
/dev/disk2               INTERNAL
    /dev/disk2

I would want to mount every drive and partition, unless it is removable (flash drive), or a CD. The mount points should be in there own folders, ex: /dev/disk0 would be mounted to /home/root/mounts/fooName1, and /dev/disk2 would be mounted to /home/root/mounts/fooName2. If this is possible without any extra programs, great. Thanks in advance!

1 Answer 1

1

It is pretty standard to specify the fixed mounting points and is done in /etc/fstab. See man fstab for details.

Note that it is a really bad idea to mount partitions in a home directory. It usually causes more confusion and disorganization than any advantage it could have. Permissions can make them available only to root if you chose to anyways.

2
  • I need to only mount internal disks though. How do I do that? Aug 30, 2016 at 1:05
  • Refer to the link I included for the fstab man page. Looking at your current /etc/fstab file can already point you in the right direction. Aug 30, 2016 at 3:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .