TransWikia.com

Why can't remount the disk with command?

Super User Asked by showkey on August 23, 2020

The /dev/sdb2 was mounted on /media/debian/WINFAT.

df /media/debian/WINFAT
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/sdb2       24406016 402256  24003760   2% /media/debian/WINFAT

enter image description here

Umount it:

sudo umount /dev/sdb2

enter image description here

Remount it with command

sudo mount /dev/sdb2   /media/debian/WINFAT
mount: mount point /media/debian/WINFAT does not exist

Why can’t remount the disk with command?

Note:you can move mouse over the WINFAT and left click to mount it.

One Answer

The target directory must exist before mounting. And it will continue to exist after unmounting. It was actually removed by something else after your 'umount' command had completed.

Your file manager handles disk mounting with the UDisks2 service, which is designed for handling portable media – so it automatically creates the mountpoint directories when needed, and it's also UDisks2 which automatically removes them as soon as the mount itself is undone.

So when using the regular 'mount' command you don't get any of this automation; you need to mkdir the target directory before you'll be able to mount anything on it.

# mkdir /media/debian/WINFAT
# mount /dev/sdb2 /media/debian/WINFAT

After unmounting a disk mounted this way, the directory should remain:

# umount /media/debian/WINFAT
# ls -l /media/debian

Or you can also call UDisks2 like your file manager does, and get the same automation:

$ udisksctl mount -b /dev/sdb2
...
$ udisksctl unmount -b /dev/sdb2

Correct answer by user1686 on August 23, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP