All the other people telling you to use terminal commands - if you like that, it's fine, but I know I would prefer knowing that GNOME Disks has a really nice GUI that allows you to mount, format, and edit the mount configured of disks, without having to directly type terminal commands or edit config files.
post
Try opening GNOME disks. Do the drives appear there? If yes, what filesystem do they use?
I’m pulling from long ago, but I think you wanna edit the fstab file. You’ll need to get UUIDs of the disks at the command line, I believe. It sounds scary, but it’s not. If I come across this post again when I’m home, I’ll post the documentation I wrote for myself when I learned about it. It was pretty thorough and easy to follow.
Here’s some other info:
https://askubuntu.com/questions/125257/how-do-i-add-an-additional-hard-drive
ETA: welcome to the Linux lifestyle! May you prosper.
Here's the documentation I created for myself seventeen years ago. It's from the perspective of a Mac user with hardly any command-line knowledge, so I was distilling things I'd learned researching all over the web that morning. Some of it may be inaccurate on technical details due to my finite understanding at the time. Hope this helps.
Mounting noauto drives using diskutil.
The challenge is how to automate the mounting of drives that have a noauto configuration in /bin/fstab.
One would normally mount these drives by using diskutil list to display the device-id of the unmounted drives. The drives could then be mounted by using diskutil mount device-id. Unfortunately, the device-id is not static and this is ,therefore, not viable for automation. The solution is to employ a shell script to mount the drives by their name.
Steps:
1. Create shell script in /bin/
2. Make the script an executable
3. Add to cron
Step 1: Creating the shell script Start by creating the script in the directory /bin/
sudo vi /bin/mounter.sh
The following is the basis for the shell script:
#!/bin/bash
theDisk=`diskutil list | awk ‘/diskName/ {print $NF}’`
diskutil mount $theDisk
Using this code, mounter.sh would be able to mount the disk "120GB" by calling its name anywhere in the command line. However, any call to diskutil run through cron will result in the following notification to /var/mail/danyoung :
/bin/mounter.sh: line 1: diskutil: command not found
/bin/mounter.sh: line 3: diskutil: command not found
The solution is use of an absolute path, as cron does not run as a shell environment. The call must be made as:
/usr/sbin/diskutil
The completed shell script looks like this:
#!/bin/bash
theDisk=`/usr/sbin/diskutil list | awk ‘/diskName/ {print $NF}’`
/usr/sbin/diskutil mount $theDisk
Step 2: Make executable After saving the file it must be made an executable:
sudo chmod +x /bin/mounter.sh
Step 3: Add to cron Add the script to cron using Cronnix. The command to execute is simply the path to the shell script:
/bin/mounter.sh
Further notes:
The shell script was discovered in an example at radiotope.com but was missing the absolute path. The solution of using an absolute path was given in a forum at macosxhints.com. The exact pages follow: 1. http://www.radiotope.com/writing/?p=64 2. http://forums.macosxhints.com/showthread.php?s=b0306f161f40e5ea07b2eea9f18ad2f2&t=60811
Additional information about writing a first shell script and making it executable was at the following: 1. http://www.macdevcenter.com/pub/a/mac/2002/07/02/terminal_5.html
Whats the difference between using backticks for the definition of theDisk and $() ?
Aha! Simple and elegant. Or, to quote another poster here, welcome to the Linux lifestyle.
This is why Linux usage on desktop will reach 50% soon (by the year 2135 or so).
- Identify the drives with the
lsblkcommand. - Run
sudo mount <path/to/drive> <mount-point>Where path/to/drive is most likely /dev/something and mount-point is any directory you want but id recommend creating it in your home folder. Don't include the angle brackets. You have to create the directory before you can mount the drive there.
If you don't want to do this every time you reboot, youll have to edit fstab like someone else said. Doing this a couple times will help you understand what fstab is actually doing.
Use gnome disks, pkg might be called gnome-disks or gnome-disks-utility, let's you set a drive to automount by default and easily name it. I usually name it a label and mount it with that name, for example, label 1TBHDD mounts to /mnt/1TBHDD
all 13 comments