2

I am wondering how I can configure an Arch Linux system to mount an external hard disk when it is plugged in (as opposed to have it plugged in at startup).

In order to to that, I added

/dev/sdb1 /mnt/E auto rw,users,umask=0000 0 0

to my /etc/fstab file.

Although I specified auto, it wouldn't automatically mount the harddisk when I plug it in. In fact, the system wouldn't even boot up without the harddisk being plugged in.

  • Is your HDD a ext4, fat or ntfs file system? – C.W. Apr 20 '17 at 8:41
  • @C.W. it is an ntfs file system. – René Nyffenegger Apr 20 '17 at 12:51
1

For read/write access you will need a read-write NTFS driver like the ntfs-3g package from extra repository.

After installation with sudo pacman -S ntfs-3g you are able to mount your NTFS partitions the usual way with sudo mount /path/to/ntfs /mount/point. This is possible due to a symlink of /usr/bin/mount.ntfs to /usr/bin/ntfs-3g.

Note: You need to have root privilegs to mount the filesystem. Requirements for an exception are listed in the ntfs-3g-FAQ.

Using the default settings the NTFS-partition will be mounted at boot. Put the following in your /etc/fstab:

/path/to/ntfs /mount/point ntfs-3g defaults 0 0

To be able to read-write with a non-root user, you have to set some additional options (username has to be changed to your username):

/path/to/ntfs /mount/point ntfs-3g uid=username,gid=users,umask=0022 0 0

0

The third field would be fs_vfstype (the type of your filesystem, ie ext4), add nofail to the fourth field to be able to boot without the harddisk being plugged in.

You need an additional tool which mounts your disk when you plug it in on runtime.

As always, all such tools are listed on the arch wiki: List of applications - Mount tools | ArchWiki

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.