Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
deb610:gemlvm [2020/06/21 18:21] – Bernard Condraudeb610:gemlvm [2026/10/11 02:01] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-===== Install logical volumes (LVM) ===== 
- 
-==== Prepare and install volumes ==== 
- 
-Prepare a single disk or a disk raid: 
-  mkfs.ext3 <phsvol> 
-  lvm 
-  lvm> pvcreate <physvol> 
-  lvm> vgcreate <physvol> // or several physical volumes: <physvol1> <physvol2> <physvol3> 
-  lvm> lvcreate <volgroup> <physical> 
-  lvm> quit 
-  mkfs.ext3 /dev/mapper/<volgroup-logvol> 
-  mount /dev/mapper/<volgroup-logvol> <dir> 
- 
-Auto-mount during boot: 
-  vim /etc/fstab 
-  /dev/mapper/<volgroup-logvol> <dir> ext3 noatime,user_xattr 0 0 
- 
-==== Install LVM manually ==== 
- 
-If you need to install LVM after having setup the base system, note that there is a bug in Edgy and Feisty where the executable files will not be found. To fix it, execute the 2nd instruction below: 
- 
-  apt-get install lvm2 
-  ln -s /lib/lvm-200 /lib/lvm-0 
- 
-==== Install LVM volumes ==== 
- 
-  - lvm > pvcreate /dev/sde1 > pvcreate /dev/md2 
-  - lvm > vgcreate vg_backup /dev/sde1 > vgcreate vg_data /dev/md2 
-  - lvm > vgdisplay vg_backup to check ### of free extents (following steps same for vg_data, but 2 logical volumes) 
-  - lvm > lvcreate -l### vg_backup (do not use -LxxGB, use size with -l### which is number of extents) 
-  - lvm > lvrename vg_backup lvol0 lv_backup 
-  - lvm > vgcfgbackup to backup volume group configurations 
-  - lvm > exit 
-  - umount /home > umount /srv 
-  - mkfs -t ext3 /dev/vg_backup/lv_backup > mkfs -t ext3 /dev/vg_data/lv_home > mkfs -t ext3 /dev/vg_data/lv_srv 
-  - mkdir /backup 
-  - mount /dev/vg_backup/lv_backup /backup > mount /dev/vg_data/lv_home /home > mount /dev/vg_data/lv_srv /srv 
- 
-  * As I use this machine as a server I did not consider to upgrade Edgy to Feisty, but I would expect that this can be done without problems. I'm not sure this is the best way or the fastest, but it worked for me. 
- 
-==== Check wether all volumes get mounted during system boot ==== 
- 
-For whatever reason, my swap volume which resides on raid1 was not mounted during system boot. After some searching I found that the uuid where not matching between /dev/disk/by-uuid and /etc/fstab. 
- 
-to check wether root and swap are mounted, enter: 
-  mount 
-  free -m -t 
- 
-to check mismatching uuid's, enter: 
-  ls -la /dev/disk/by-uuid 
-  cat /etc/fstab 
- 
-to fix, do: 
-  vim /etc/fstab 
-replace the uuid's found in fstab with the ones found in /dev/disk. Make sure you copy the correct uuid (md0, md1) to the respective entry in fstab.