0

I am building a home server to host a few self hosted apps in docker (Ubuntu LTS). I would like to put all the files for the apps in the user home folder to keep them in one place and easy back up. I am thinking about 2 x main folders: /home/user/docker – for docker compose and all docker volumes and /home/user/data – for all my files:

/home/user/ docker/ container1 container2 … data/ entertainment/ movies series music downloads/ documents/ photos/ personal files/ backups/ laptop_backups/ phone_backups/ 

I will assign the data/ folder to Nextcloud for access from family laptops and phones.

I have a 500GB SSD, 1TB HDD + a few different smaller size HDD’s + probably will add more HDD’s in the future. Maybe also one more SSD.

I am planning to divide the storage as LVM:

SSD – 2 partitions: 100GB & 400GB HDD – 1 partition: 1TB

I will create 3 x Volume Groups: 100GB – “system”, 400GB – “SSD”, 1TB – “HDD”.

I am thinking about a following set up:

  1. VG 100GB “system” – LV “system” for /

  2. VG “HDD” – LV “slow data” for:

     /home/user/data/entertainment /home/user/data/backups /home/user/data/downloads 
  3. VG “SSD” – LV “fast data” for:

     /home/user/data/documents /home/user/user/docker 

My question is: how to best divide the storage between Volume Groups and Logical Volumes? I would like to have a flexible set up so that I could resize and change disk storage in the future and at the same time use the SSD space in the best way.

6
  • that sounds like a bunch of old, small HDDs. Considering the price of prosumer 1 TB (ca 55€ for 1TB of fast SSD) SSDs, hm, maybe retire your hard drive sooner rather than latrer and only have fast, more reliable storage? I think you're overengineering herding a bunch of HDDs that are probably getting close to the end of their lives. Commented Sep 23, 2023 at 19:33
  • and having a separate System volumne group seems inadvisable, altogether. It looks like you're essentially trying to reconstruct what a 1990's admin would have done on the inflexible partitioning approach to hard drives. Commented Sep 23, 2023 at 19:35
  • Isn't that what Volume Groups are for? Later If I change the drives I will just change the PV's in the storage Volume Group. And all my LV's will stay the same. Commented Sep 24, 2023 at 8:00
  • Yes but you don't need the volume groups for that. One would suffice! Commented Sep 24, 2023 at 8:43
  • One VG will not let me allocate the system to SSD and later resize when I change the drive. Commented Sep 24, 2023 at 8:57

1 Answer 1

2

I used to do something like this, but in the end concluded that splitting storage up into volume groups according to some combination of speed and intended use is counter-productive. It introduces an artificial limitation in how storage can be used, and the taxonomy doesn’t last long given the evolution of storage — your “slow data” may well end up being fast if you add a large SSD to the VG...

I recommend using a single VG for all your system’s storage, and for LVs where it matters, controlling which PVs they end up being stored on (which is easy to do if a PV has enough spare capacity when you create the LV, or can be done in other cases using pvmove). This also means that if you realise your choices weren’t perfect, you can still easily fix them, again using pvmove (and resizing LVs if necessary).

7
  • also: if you really have enough storage in principle and don't mind using your SSDs primarily as fast cache for mass storage, man lvmcache; haven't tried that, but always wanted to. Commented Sep 23, 2023 at 19:36
  • If I add more SSD's in the future would I not just add them to SSD VG and remap and copy LV's to the fast storage until the HDD VG is empty? If I for instance assign the whole 500GB to / and all my HDD's to /data folder I will just waste the space, as it will never get used. I now have barely 50GB in use for /. Commented Sep 24, 2023 at 8:11
  • @MarcusMüller I looked into it and lvmcache actually sounds like the best option to use the free SSD space! I could allocate 100GB to the system. Assign /home LV to the HDD VG with cache using the rest of the SSD. Commented Sep 24, 2023 at 8:59
  • It would make little sense to share an SSD between regular and cache usage. You only get its bandwidth once. Commented Sep 24, 2023 at 9:00
  • So it should be all or nothing in regards to cache? Either one VG with HDDs and SSD as cache or my original set up. Unless I get one more SSD. Commented Sep 24, 2023 at 9:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.