0

I've connected my hard drive by usb but the contents do not appear in /media.

When I mount it manually using mount /dev/sdb1 /media/user it succeeds.

When I list the contents of the fstab this is what I get:

#cat /etc/fstab
# /etc/fstab: static file system information.

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

/ was on /dev/sda2 during installation

UUID=number / ext4 errors=remount-ro 0 1

/boot/efi was on /dev/sda1 during installation

UUID=number /boot/efi vfat umask=0077 0 1 /swapfile none swap sw 0 0

I am not sure if the device should appear there, also running lsblk, I see it (sdb1):

$ lsblk -f
sdc
└─sdc1 ntfs     username id

Why it is not mounting automatically?

EDIT: included a better description of the problem.

1 Answers1

0

You have to create a new entry in the /etc/fstab file.

  1. with this command:
sudo  blkid

you get important information which UUID-number your /dev/sdb1 drive have. Save the number in a text-file.

  1. Create the directory for the target path, where you want to mount your new drive. As an example you can chose a folder with the name "mydata" in your home directory. Maybe: "/home/minsky/mydata "

There you can save all your personal data and they are separated from the operating system HDD and the OS-partition.

  1. Then you can create the new mountpoint in your fstab file.

Open the /etc/fstab file with:

sudo mousepad /etc/fstab

and create a new line where you can put in a line like this:

# My 1TByte SSD or HDD
UUID=50eebbff-8f43-4a11-8877-8abb2233246     /home/minsky/mydata    ext4    defaults,noatime,nodiratime,discard,nobh,data=ordered,commit=120          0       2

Replace the UUID number in this example with the number from your research.

Now your fstab would looks like this:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=number /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=number  /boot/efi       vfat    umask=0077      0       1
#
# My 1TByte SSD or HDD
UUID=50eebbff-8f43-4a11-8877-8abb2233246     /home/minsky/mydata    ext4    defaults,noatime,nodiratime,discard,nobh,data=ordered,commit=120          0       2
#
/swapfile                                 none            swap    sw              0       0

Note:

You can see the type of the filesystem with:

df -T

If your drive is an SSD (or M.2 - SSD) and formated with f2fs (the flash friendly filesystem), then your mount entry in fstab should looks like this:

# My 1TByte SSD
UUID=50eebbff-8f43-4a11-8877-8abb2233246     /home/minsky/mydata    f2fs      rw,noatime,nodiratime,nosuid,nodev,discard,background_gc=off,inline_xattr,active_logs=2   0    0

If it is an NTFS-filesystem it looks like this:

UUID=077BBEE22CCA2110       /home/minsky/mydata     ntfs  rw,user,noauto,uid=0,gid=46,umask=007,nls=utf8                  0   0

(replace the example-UUID with the UUID of the f2fs or NTFS-partition)