Quantcast
Channel: Active questions tagged mount+fstab - Ask Ubuntu
Viewing all articles
Browse latest Browse all 699

Binding mounted SSD under /home using fstab, can you use the /proc/mounts path?

$
0
0

I have three SSDs in my system. The first, physically in the hardware (if that matters), is my Windows installation, the second my Ubuntu 20.04 installation, and the third is an NTFS storage drive. I am attempting to more easily interact with the storage drive.

The behavior that I would like to implement is that under /home I have a directory which "looks like" my storage drive. That is, if I open the directory it displays all the same sub directories and files present on the drive; any changes made in this directory automagically simultaneously happen on the storage drive/data. This way I can work with /home instead of having navigate into another directory.


I am reviewing this Ask Ubuntu answer and it seems to provide a partial solution. The original questions asks how to ensure a bind stays present after a system reboot. The answer provides the solution to enter an fstab entry akin to

# <device>                                 <dir>                 <type>  <options>                 <dump>  <pass>UUID=288a84bf-876c-4c4b-a4ba-d6b4cc6fc0d2  /mnt/device            ext4    defaults,noatime,nofail   0       2/mnt/device                                /srv/binded_device     none    bind

where the device, addressed by its UUID, is mounted to /mnt/device and then /mnt/device is binded to /srv/binded_device. Though I can't quite gather how to apply this to my situation.

So my device /dev/nvme2n1p2 (an NTFS partition spanning the entire drive) is mounted to /media/<user>/Storage in /proc/mounts

dev/nvme2n1p2 /media/<user>/Storage fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0

But I can also gather both the UUID and PARTUUID via sudo blkid

dev/nvme2n1p2: LABEL="Storage" UUID="8E7C25407C252485" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="880d93fe-65da-45d9-b7ec-322bc51cdd52"

EDIT: I just realized other Ask Ubuntu answers provide a solution to this first question.

My first question is if I were to follow the pattern presented by the linked answer should I use the UUID or PARTUUID in fstab?

Like so (in the case of using PARTUUID)

# <device>                                 <dir>                 <type>  <options>                 <dump>  <pass>UUID=880d93fe-65da-45d9-b7ec-322bc51cdd52   /mnt/storage         ntfs    defaults,noatime,nofail   0       2/mnt/storage                                /home/StorageBind    none    bind

Second and third, again following from the linked answer, where to and what should I call the mount location? Can I just call it /mnt/storage? Should I alter the type in fstab to be ntfs, what other options should I include/remove?


Rather, can I just address the drive in fstab as the mounted location from /proc/mounts? Essentially allowing me to bypass the first three questions..

Like so

# <device>               <dir>               <type>  <options>  <dump> <pass>/media/<user>/Storage    /home/StorageBind    none    bind

Additional questions that may influence the answer for my specific use case (though I think the question still has general purpose merit).

This storage drive contains some code which produces various result files. The code must be ran in a Docker container that can only be run under a linux installation (nvidia-docker), though I am still also inextricably linked to using Windows for various administration tasks on the results. In the past, or when not using the storage drive, I will use Docker's bind-mount option to mount a host directory within the container (one containing my codebse).

So I am specifically worried/interested if this bind works as desired and described above, would I be able to further docker --mount/docker --volume the bind to the storage drive?

docker <...> -v /home/StorageBind/<codebase>:/code

Viewing all articles
Browse latest Browse all 699

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>