0

say I have two virtual disks (dev/sda and dev/sdbadded to my ESX CentOS 7 VM). I create two partitions (dev/sda1 and /dev/sdb1). Then I create a physical volume for each and create a volume group named storage-vg and two logical volumes data and application. File system created as well: mkfs.ext3 /dev/storage-vg/data mkfs.ext3 /dev/storage-vg/application

My question is where do I mount them now ? I mean if I mount to a directory that contains already data the data will be hidden so to say. What is the best practice ? Should I create two empty directories under / ?

It might be a silly question but for someone will almost only Windows experience it's hard to understand.

  • This seems to me to hover on the "opinion-based" guideline; you can mount them anywhere you want, and there are impacts to over-mounting existing directories, as you note. Really, it boils down to "whereever you want" – Jeff Schaller Apr 12 '18 at 12:49
  • @JeffSchaller Thanks Jeff. That makes sense! – yesOrMaybeWhatever Apr 12 '18 at 13:51
0

If you want to have exactly one place for every mount point aside from root /, you could use the standard /mnt/my-mount-point. And eventually symlink if necessary.

I do this for my home folder for example and find it very clean, but ultimately it is opinion-based.

Scenario

I am mounting /dev/sda1 in /mnt/downloads but I'd like to access this folder from ~/downloads. So I symlink it with ln utility:

ln -s /mnt/downloads $HOME/downloads

And now, doing

cd ~/downloads

Is equivalent to

cd /mnt/downloads
  • And eventually symlink if necessary. Symlink what exactly? Can you give please an example? – yesOrMaybeWhatever Apr 12 '18 at 13:50
  • @yesOrMaybeWhatever I updated my answer to clarify :-) – Jules Randolph Apr 12 '18 at 13:57
  • I would discourage /mnt personally, as I (and others?!) have a habit of mounting temporary things at /mnt, which would cover up child mounts. – Jeff Schaller Apr 12 '18 at 14:32

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.