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

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.

  • I need to only mount internal disks though. How do I do that? – Skyler Spaeth Aug 30 '16 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. – Julie Pelletier Aug 30 '16 at 3:00

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.