1

having working external hard disk which is accesble in macOS and windows ( might be NTFS but not sure ) and used to be mounted in windows and mac but when tried in ubuntu ; it gives error

lsblk

show /sda/sda1 is the address ; here is part of output lsblk output

created a directory ~/external we when write

> sudo mount /dev/sda/sda1 ~/external/

mount: /home/user/external: special device /dev/sda/sda1 does not exist (a path prefix is not a directory). dmesg(1) may have more information after failed mount system call

in File manager it display the drive but when click on it external hard disk error

7
  • 1
    What file system was this external drive formatted with?
    – David DE
    Commented Aug 10 at 15:29
  • 3
    Are you sure you are reading the lsblk output correctly? it is much more likely to be just /dev/sda1. Please edit your question to include the actual text output from the command. Commented Aug 10 at 15:49
  • The ~ is a shortcut to the logged in users home folder. It does not make sense in /etc/fstab. No one is logged in when the computer boots and fstab is executed. The ~ may be expanded to /root/ at best in this case.
    – user68186
    Commented Aug 10 at 15:50
  • 4
    /dev/sda/sda1 is NOT a device so fix that please The image also tells you it is /dev/sda1.
    – Rinzwind
    Commented Aug 10 at 16:00
  • where do we create directiory than? I can access the ~/external
    – xkeshav
    Commented Aug 10 at 16:35

1 Answer 1

3

/dev/sda/sda1 is NOT a device so fix that please The image also tells you it is /dev/sda1.

Also please drop the ~.

sudo mount /dev/sda/sda1 /home/$USER/external/

from command line. But do alter $USER to the actual directory when using /etc/fstab.

It is more useful to mount in /media is this is external storage or to a personal mountpoint in / (I use /discworld mysql). I keep my personal directories there too (ie. Desktop, Documents, etc). Makes it portable.

3
  • Hmmm I'd argue at least when running commands from Bash ~ is generally safer? What if the home directory is in a non-standard location / not named as the user? Or $USER is not defined for whatever reason? Granted, 99 times out of 100 /home/$USER and ~ will output the same.
    – kos
    Commented Aug 11 at 6:47
  • you really do not want 2 users on the same system to execute that command: you get 2 mountpoints and umount will error out, Better to chmod the files and dirs (have to do that anyways unless you want to use sudo for every action) so the disk is already protected
    – Rinzwind
    Commented Aug 11 at 6:51
  • "Also please drop the ~." - Why? There's no reason to prefer /home/$USER/ over ~. Both get expanded by the user's shell before being passed to sudo.
    – marcelm
    Commented Aug 11 at 9:26

You must log in to answer this question.

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