Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
58
rated 0 times [  58] [ 0]  / answers: 1 / hits: 421265  / 2 Years ago, sat, november 12, 2022, 2:43:53

It is my second day on Linux. I am having difficulties mounting an USB drive. It shows this error:



mount: can't find /dev/sdb1/mnt in /etc/fstab or /etc/mtab


How can I get rid of this error?


More From » 14.04

 Answers
0

Why this error?



You probably forgot to tell mount where to mount your drive.



Linux uses device files (/dev/sda, /dev/sdb1, etc.). And unlike Windows drives (C:, D:, etc.), you cannot access them directly (cd /dev/sdb1 will inevitably fail, telling you that it is not a directory but a file). If you want to open a drive with mount, you need to provide a mountpoint. A mountpoint is a directory wherein your USB drive will be opened and where you will be able to access your files.






Solution




  1. Create a directory that you will use as the mountpoint for your drive:



    mkdir /mnt/mydrive

  2. Mount your drive with this command:



    mount /dev/sdb1 /mnt/mydrive


    Note: If you don't know your drive's device file, you can run sudo fdisk -l or lsblk to identify the partition you're looking for.


  3. Now if you run ls /mnt/mydrive, it should list your drive's files.


  4. When you're done, don't forget to unmount your USB drive before removing it from the computer:



    umount /dev/sdb1






More information about this error



/etc/fstab is a file in which you can associate a partition with a mountpoint, allowing you to run mount <device> instead of mount <device> <mountpoint>. This is why you get this confusing error.



fstab has many more uses like mounting a partition at boot time, etc. More information about fstab on the Arch Linux wiki


[#15320] Monday, November 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dersol

Total Points: 78
Total Questions: 100
Total Answers: 124

Location: Christmas Island
Member since Mon, Oct 19, 2020
4 Years ago
;