Version 2 (modified by jsalamero@…, 4 years ago) (diff)

--

Safe upgrade

% cd /boot
% tar czf boot.tar.gz *
% mv boot.tar.gz /mnt/backups
% vgdisplay -C
File descriptor 4 left open
  VG   #PV #LV #SN Attr   VSize VFree
  ebox   1   3   0 wz--n- 7.76G 1.26G
% lvdisplay -C
File descriptor 4 left open
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%
  root ebox -wi-ao   4.00G
  swap ebox -wi-ao 512.00M
  var  ebox -wi-ao   2.00G
% lvcreate --snapshot --name stable --size 1G /dev/ebox/root
File descriptor 4 left open
  Logical volume "stable" created
% lvdisplay -C
File descriptor 4 left open
  LV     VG   Attr   LSize   Origin Snap%  Move Log Copy%
  root   ebox owi-ao   4.00G
  stable ebox swi-a-   1.00G root     0.01
  swap   ebox -wi-ao 512.00M
  var    ebox -wi-ao   2.00G
% mkdir /mnt/tmp
% mount -t ext3 /dev/ebox/stable /mnt/tmp/

#FIXME use UUID?

/dev/ebox/stable /               ext3    relatime,errors=remount-ro,usrquota,grpquota 0       1
% umount /mnt/tmp
% rmdir /mnt/tmp
% lvdisplay -C
File descriptor 4 left open
  LV     VG   Attr   LSize   Origin Snap%  Move Log Copy%
  root   ebox owi-ao   4.00G
  stable ebox swi-a-   1.00G root    10.54
  swap   ebox -wi-ao 512.00M
  var    ebox -wi-ao   2.00G
% lvremove /dev/ebox/stable
File descriptor 4 left open
Do you really want to remove active logical volume "stable"? [y/n]: y
  Logical volume "stable" successfully removed
% lvdisplay -C
File descriptor 4 left open
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%
  root ebox -wi-ao   4.00G
  swap ebox -wi-ao 512.00M
  var  ebox -wi-ao   2.00G