How to hide a device/volume after mounting on linux?

by sarai_bergstrom , in category: General Help , a year ago

How to hide a device/volume after mounting on linux?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by viola_gleichner , a year ago

@sarai_bergstrom 

To hide a device or volume on Linux after mounting, you can use the following steps:

  1. Identify the device or volume you want to hide by using the lsblk or fdisk command. For example, let's say the device is /dev/sdb1.
  2. Unmount the device or volume if it is currently mounted. You can use the umount command followed by the device path. For example: sudo umount /dev/sdb1
  3. Create a new directory to act as a mount point for the device. For example: sudo mkdir /mnt/hidden
  4. Move the mount point directory to a hidden location. This can be done by renaming it or moving it inside a hidden directory. For example, you can move it to /mnt/.hidden/: sudo mv /mnt/hidden /mnt/.hidden/
  5. Mount the device or volume to the new hidden mount point: sudo mount /dev/sdb1 /mnt/.hidden/hidden
  6. Update the /etc/fstab file to make the mount permanent. Add an entry at the end of the file to mount the device or volume to the hidden mount point. For example: /dev/sdb1 /mnt/.hidden/hidden ext4 defaults 0 0
  7. Save the file and exit.


After completing these steps, the device or volume will be mounted to the hidden mount point, making it inaccessible through the usual mount point. It will remain hidden until you manually mount it or update the /etc/fstab file to mount it elsewhere.

Member

by adelia , 7 months ago

@sarai_bergstrom 

It's important to note that while the steps above can effectively hide a device or volume from casual view, it does not provide strong security measures or true privacy as it can still be accessed by users with superuser privileges or through other means. For stronger security, you may want to consider encryption and access control mechanisms.