0

I installed a new hard drive that will be used for additional storage only. I have followed these instructions on Ubuntu pages to partition it, but when I follow the instructions to automatically mount it, I get lost. It tells me to enter a new line in fstab but when I enter the line, there is no way to press enter and confirm. I also see it says something about using uuid but that link is no help either.

The output of sudo fdisk -l:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1   488397167   244198583+  ee  GPT

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00034d6c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  1953523711   976760832   83  Linux

sudo blkid:

/dev/sda1: UUID="9EDD-FADC" TYPE="vfat" 
/dev/sda2: UUID="f45d9121-db97-4b97-bdf1-6db2ceaaa3b6" TYPE="ext4" 
/dev/sda3: UUID="f908decc-66cd-41ec-a588-7df965077dea" TYPE="swap" 
/dev/sdb1: UUID="4dfbef06-0f1a-4ec4-a637-0ea911e656ba" TYPE="ext4" 

cat etc/fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=f45d9121-db97-4b97-bdf1-6db2ceaaa3b6 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=9EDD-FADC  /boot/efi       vfat    defaults        0       1
# swap was on /dev/sda3 during installation
UUID=f908decc-66cd-41ec-a588-7df965077dea none            swap    sw              0       0
UUID=4dfbef06-0f1a-4ec4-a637-0ea911e656ba /media/micah/new_hd ext4 defaults 0 2
2

2 Answers 2

0

The answer was changing the ownership. I moved the directory to /home/micah/Media instead of /media/micah/new_hd. I then entered sudo chown micah:micah /home/micah/Media -R and after a reboot I now have permission to use the hard drive. One question. I know I can use the hard drive listed under devices but is there a way to have the "Media" folder show up on the left side of Nautilus just like "Pictures, Videos"? Thanks for all your help @girardengo

2
  • i have edit my answer, add sudo chmod 777 /media/<username>/new_hd and changing fstab line, from defaults to rw,user,exec. This may fix permission problems. Your solution did also work.
    – girardengo
    Apr 27, 2014 at 17:24
  • Go to the folder you want to link. Either press Ctrl+D or go to the top menu bar and select Bookmarks -> Add Bookmark.
    – girardengo
    Apr 27, 2014 at 17:28
0

Mounting partition require first mount point. Create a directory where you want to mount the partition of new hdd:

sudo mkdir /media/<username>/new_hd
sudo chmod 777 /media/<username>/new_hd

(Note that the first time you use the sudo command prompts you to enter your password)

Second step, find the UUID of the partition to mount:

sudo blkid

read output, and copy the relevant UUID.

Finally, edit /etc/fstab (assuming that the filesystem is ext4):

fields in fstab are:

<file system> <mount point>   <type>  <options>       <dump>  <pass>

so add this line:

UUID=<uuid_new_hd> /media/<username>/new_hd ext4 rw,user,exec 0 2

To do that, remember to edit with superuser permission, then using sudo:

sudo gedit /etc/fstab

Note: Gtk-WARNING when execute this command is normal. instead of gedit you can use nano or vim (non-GUI editor).

Check if new line was added, by typing:

 cat /etc/fstab

Then mounting and checking the partitions typing the following command in terminal:

sudo mount -a

If everything is ok, this command should not give back any output, and partition the new hd should be mounted.

Type man fstab for more help and options, or read here as suggested, and type man sudo for help with sudo command.

9
  • mkdir: cannot create directory ‘/media/micah/new_hd’: Permission denied . That's the message I got after trying the first command.
    – xmjsilverx
    Apr 26, 2014 at 1:01
  • @user254074 sorry, my mistake. The command must be run with superuser permissions. I edited my answer with the correct command.
    – girardengo
    Apr 26, 2014 at 7:37
  • I really appreciate your help. I am not sure if I am messing something up but after I enter sudo gedit/etc/fstab it opens a text editor and I can't add a new line unless I hit enter. When I hit enter it gave me this message. I continued to enter my new line and save and this is what terminal showed through that process. My HD is still not functional.
    – xmjsilverx
    Apr 27, 2014 at 0:52
  • (gedit:26287): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files (gedit:26287): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files micah@micah-desktop:~$ sudo
    – xmjsilverx
    Apr 27, 2014 at 0:53
  • micah@micah-desktop:~$ sudo usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>] usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ... micah@micah-desktop:~$ sudo mount -a micah@micah-desktop:~$
    – xmjsilverx
    Apr 27, 2014 at 0:53

You must log in to answer this question.

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