Score:0

Problems mounting hard drive

mx flag

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.

terdon avatar
cn flag
When you say you have mounted it but the contents don't appear, what do you mean exactly? How have you mounted it? There is no mention of `/media` in your `fstab` file, so this drive won't be mounted automatically.
ar flag
What is the difference between "I've mounted by hard drive" and "When I mount it manually"? How did you mount "by" hard drive? Do you use a command (if so what)? Do you use an app, like Gnome Disk? How is the drive formatted, `ext4`, `NTFS`, or something else?
oldfred avatar
cn flag
If internal drive you want to add an entry to fstab. You have to create mount point, edit fstab and give yourself ownership & permissions if Linux format. If NTFS, it only uses default from parameters in fstab mount. An example: https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting/1013700#1013700 If external drive you need extra parameters & if NTFS additional parameters suggested.
Minsky avatar
mx flag
@terdon thanks. I run `sudo mount /dev/sdb1 /media/username`, and that is what I mean by manually mounting the external hard drive.
Minsky avatar
mx flag
@user68186 that was very vague but I didn't even noticed it. Updated.
terdon avatar
cn flag
When you connect the drive, does an icon for it appear on your desktop or in your file manager? If this is a USB drive (which kind of changes everything and wasn't mentioned originally), then it won't be mounted at `/media` but somewhere under `/run/media/`. So, do you see an icon on the desktop?
Minsky avatar
mx flag
@terdon But it was normally (in a fresh installation) mounted in `/media/user`
Score:1
ro flag

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)

Minsky avatar
mx flag
will accept once i can fully test if it works fine. +1
MikroPower avatar
ro flag
You have to mount your new Harddrive and then check which filesystem does it have! With the command: df -T , you can see the type of filesystem of your new drive. If it is a ntfs filesystem, then the mount-entry in fstab is different.
Minsky avatar
mx flag
thanks, but it is written in the post
MikroPower avatar
ro flag
Okay, I have updated the answer for you.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.