0

I have a little (and might sound stupid) question.. but google didn't got me to a solid answer in all the weekend.

I am planning to make a file/webserver server for home/development use.. And I want to use LVM to be able to add storage space in the future, but I dont want to risk any important data.

Hardware I have:

  • 160GB 3.5" Sata 2 HDD
  • 1TB 3.5" Sata 3 HDD
  • 3TB 3.5" Sata 3 HDD

Data:

Here is a list of what I plan to store and its location/importance (asterisk means that data cannot be recovered/re-downloaded if a disk fails):

  • *Pictures
  • *Home Folders (/home/me and /home/wife)
  • *iTunes Library
  • Movies / TV Shows
  • Software
  • Steam/Origin Game backups (games that I use in LAN parties, but not all the time)

Plan:

I've planned to setup 2 LVMs:

  • LVM0 with the 160GB disk (solo) for the root, boot and swap partitions;
  • LVM1 with the 1TB and 3TB disks.

So in the future if I run out of space on any of both LVMs I can snap another hard-drive and expand the desired LVM.

I am planning to setup the /media/4tb-lv mount which would be the root for the single-partitioned LVM1:

  • /media/4tb-lv/pictures
  • /media/4tb-lv/software
  • /media/4tb-lv/videos
  • /media/4tb-lv/games
  • /media/4tb-lv/itunes
  • /media/4tb-lv/homes/me
  • /media/4tb-lv/homes/wife

then I'll symlink the /home/me and /home/wife to their respective real directories

Backups

As I mentioned before, Pictures, Homes and iTunes folders cannot be lost in a hdd failure. So, I am planning to create a /backups directory in the LVM0 and use rsync to sync those 3 folders (on a daily basis) to the /backups dir... So, in case the LVM1 fails I can recover the data from the LVM0. These directories are not that huge.. in fact today the sum up to 50GB total (it fits perfectly in the 160GB disk)...

Finally: the questions!

This setup looks almost perfect for my setup.. but I have only one minor doubt...

Lets assume that the 160GB disk dies completely, so the /, /boot, /backup, /etc and all the other files stored on it are gone forever..

1) What happens to the second LVM?

2) Can I still access the data if I boot a live disk?? How can I do that?

3) I Mac OS X you can install the OS in drive A, and then setup a raid0 with drive B+C and if you drive A dies, you just need to reinstall OSX in a new drive and the raid0 b+c will be available even in the installation process without the need to configure anything as the metadata is stored in the B and C drives. How LVM manages its metadata?

I appreciate your help guys!

0

The data stored in /etc by the volume manager tools is only a cache. The real storage location for this information is within the first 192K of each physical volume in the group.

A live CD has no problem what so ever creating the device mappings. If it doesn't do it automatically the command

vgchange -a y lvm0

will find the group and create all the relevant mappings.

LVM's mirroring isn't the nicest around (IIRC you need a third drive to store some sort of log) IME it's better to use mdadm to manage mirroring and other RAID patterns. The place the LVM PV onto the /dev/md0 drive. Mdadm likewise will work fine from a live CD just needing an mdadm 'Assemble' command if it doesn't startup automatically.

I'm currently using RAID10 mdadm on six drives on one machine and LVM instead of partitions or in addition to partitions on others.

Note: Grub will probably insist on a dos partition table to boot from; lilo does not.

|improve this answer|||||
  • Yes, you're right. I've created a VM and added 3 disks... Installed centos7, and configd the VG as I said in the question... then turned off the VM, removed the sda disk and booted from the centos install CD again.. vgscan showed the VG and then vgchange -ay made it available to mount the partitions... about grub.. yes, the idea is to have a /dev/sda1 as /boot (ext4), /dev/sda2 as VG (lvm partition type) and inside this VG create the / and swap partitions (this is the default centos 7 schema) as LV. Later I can add a disk to the VG and expand root the partition – KnF Feb 23 '15 at 23:01
  • About backup I do not intent to use mirroring or snapshots.. just rsync to prevent data loss on the mentioned directories – KnF Feb 23 '15 at 23:02

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.