{"id":176369,"date":"2013-04-11T17:42:03","date_gmt":"2013-04-11T13:42:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=176369"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=176369","title":{"rendered":"<span class=\"post_title\">\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c RAID1+LVM (\u0434\u043b\u044f \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b) \u0432 Hetzner \u0438 ServerLoft<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/b5b\/908\/7ab\/b5b9087ab097db6bbe79cd3556d05624.jpg\" align=\"left\"\/><br \/>  \u0417\u0430\u0432\u0430\u043b\u044f\u043b\u0430\u0441\u044c \u0443 \u043c\u0435\u043d\u044f \u0442\u0443\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u043a\u0430\u043a \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c LVM \u043d\u0430 \u0434\u0432\u0443\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 dedicated-\u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430\u0445: Hetzner \u0438 ServerLoft. \u041f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0435\u0435 \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>  LVM \u0432 Linux \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0435\u0434\u0438\u043d\u043e\u043c\u043e\u043c\u0435\u043d\u0442\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u00ab\u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u044b\u0435\u00bb \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0431\u044d\u043a\u0430\u043f\u0438\u0442\u044c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445: \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u044d\u043a\u0430\u043f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e rdiff-backup \u0438\u043b\u0438 duplicity (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 FTP-\u0441\u0435\u0440\u0432\u0435\u0440, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043d\u043e\u0433\u0438\u0435 \u0445\u043e\u0441\u0442\u0435\u0440\u044b). \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f RAID-1 (\u0437\u0435\u0440\u043a\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 2 \u0434\u0438\u0441\u043a\u0430\u0445), \u0442\u043e \u043e\u043d\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0434\u0438\u0441\u043a\u043e\u0432 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0443. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c LVM \u043f\u043e\u0432\u0435\u0440\u0445 RAID-1.<\/p>\n<p>  \u041d\u043e \u0431\u0435\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0438 Hetzner, \u043d\u0438 ServerLoft \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c LVM \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u00ab\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u043c\u044b\u0448\u043a\u043c\u00bb. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0438 \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u041e\u0421, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0447\u0442\u043e \u2014 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c RAID-1. \u041d\u0438\u0436\u0435 \u2014 \u0434\u0432\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u00ab\u043d\u0430\u043b\u0438\u0442\u0443\u044e\u00bb \u043c\u0430\u0448\u0438\u043d\u0443 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 LVM \u0434\u043b\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u043f\u043e\u0442\u043e\u043c \u2014 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430\u043c\u0438. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0441 Ubuntu Server 12.04 minimal (\u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u041e\u0421 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f).<a name=\"habracut\"><\/a><\/p>\n<p>  <b>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/b> \u0435\u0441\u043b\u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435 \u0432\u0441\u0435 \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0435 \u0436\u0430\u043b\u043a\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u041d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441 \u00ab\u0436\u0438\u0432\u044b\u043c\u00bb \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0434\u043e\u0441\u043a\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0435.<\/p>\n<h5>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c LVM \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0432 Hetzner<\/h5>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e 220G \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 (\u0432\u0441\u0435\u0433\u043e LVM-\u0442\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 300G, \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0435\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432). \u0415\u0441\u043b\u0438 \u0434\u0438\u0441\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u0432\u0430\u043c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u043d\u0435\u0435 \u043c\u0435\u0441\u0442\u043e, \u043b\u0443\u0447\u0448\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 RAID-1 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u0432\u0430\u0440\u0438\u0439.<\/p>\n<ol>\n<li>Select OS type \u00abrecover\u00bb when you install a new machine.<\/li>\n<li>Login via SSH and run \u00abinstallimage\u00bb command (just type \u00abinstallimage\u00bb and press Enter).<\/li>\n<li>Select Ubuntu-1204-precise-64-minimal.<\/li>\n<li>Enter the following configuration to the opened editor:<br \/> \n<pre> DRIVE1 \/dev\/sda DRIVE2 \/dev\/sdb SWRAID 1 SWRAIDLEVEL 1 BOOTLOADER grub HOSTNAME newhost PART \/boot  ext2     512M PART lvm    vg0      300G # We use only 200M of our large HDD to speedup RAID1 rebuild if it happens. # Anyway, we do not need so much space, so 200G is enough. LV vg0  swap  swap  swap      4G LV vg0  tmp   \/tmp  reiserfs  10G LV vg0  root  \/     ext3      220G IMAGE \/root\/.oldroot\/nfs\/install\/..\/images\/Ubuntu-1204-precise-64-minimal.tar.gz <\/pre>\n<\/li>\n<li>Press F2, then F10 and wait until the installation is finished.<\/li>\n<\/ol>\n<p>  <\/p>\n<h5>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c LVM \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0432 ServerLoft<\/h5>\n<p>  \u0412 ServerLoft \u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0431\u043e\u0433\u0430\u0442\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a Hetzner-\u043e\u0432\u0441\u043a\u0438\u0439 installimage, \u0430 \u0442\u0430\u043a\u0436\u0435 lvm2 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041d\u0435\u043c\u0430\u043b\u043e \u043a\u0440\u043e\u0432\u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u043b\u0438\u0442\u043e \u043d\u0430 \u0435\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041d\u0438\u0436\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c LVM-\u0442\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 80% \u043e\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f 20% \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430.<\/p>\n<ol>\n<li>Select OS type \u00abUbuntu 12.04 Minimal, software RAID1\u00bb at <a href=\"https:\/\/my.serverloft.com\/en\/Dedicated\/Restore\">my.serverloft.com\/en\/Dedicated\/Restore<\/a><\/li>\n<li>Enter the recovery mode after the installation is finished at <a href=\"https:\/\/my.serverloft.com\/en\/Dedicated\/Recovery\/Index\">my.serverloft.com\/en\/Dedicated\/Recovery\/Index<\/a><\/li>\n<li>Run the following commands to prepare partitions:<br \/> \n<pre> export DEV_BOOT=\/dev\/md0 export DEV_LARGE=\/dev\/md2 mdadm -A --scan mkdir \/rootcopy   mount $DEV_LARGE \/mnt   cp -a \/mnt\/* \/rootcopy   umount $DEV_LARGE pvcreate $DEV_LARGE   vgcreate vg0 $DEV_LARGE   lvcreate --name tmp  --size 10G vg0   lvcreate --name root -l 80%FREE vg0   mkfs.ext4 \/dev\/mapper\/vg0-tmp   mkfs.ext4 \/dev\/mapper\/vg0-root mount \/dev\/mapper\/vg0-root \/mnt   cp -a \/rootcopy\/* \/mnt   rm -rf \/rootcopy   mount $DEV_BOOT \/mnt\/boot     mount -o bind \/dev \/mnt\/dev     mount -t proc none \/mnt\/proc     mount -t sysfs none \/mnt\/sys     perl -p -i -e 's{^[^\\s#]+(\\s+\/\\s+)}{\/dev\/mapper\/vg0-root$1}s' \/mnt\/etc\/fstab     echo &quot;\/dev\/mapper\/vg0-tmp  \/tmp  ext4  defaults,noatime 0 4&quot; &gt;&gt; \/mnt\/etc\/fstab     chroot \/mnt apt-get install lvm2 --yes     chroot \/mnt update-grub     chroot \/mnt grub-install \/dev\/sda     chroot \/mnt grub-install \/dev\/sdb     umount \/mnt\/sys     umount \/mnt\/proc     umount \/mnt\/dev     umount $DEV_BOOT   umount \/dev\/mapper\/vg0-root <\/pre>\n<\/li>\n<li>Reboot the server, then in 30 seconds \u2014 stop the recovery mode at <a href=\"https:\/\/my.serverloft.com\/en\/Dedicated\/Recovery\/Index\">my.serverloft.com\/en\/Dedicated\/Recovery\/Index<\/a> (maybe reboot twice if the first reboot will not succeed).<\/li>\n<\/ol>\n<p>  <\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430\u043c\u0438<\/h5>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u0435\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 LVM, \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u043c\u0430\u0433\u0438\u044e:<\/p>\n<p>  <font color=\"gray\"># \u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u0431\u044b\u043b\u0438 \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0439\u0447\u0430\u0441.<\/font><br \/>  lvremove -f \/dev\/vg0\/snap 2&gt;\/dev\/null<br \/>  <font color=\"gray\"># \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043d\u0430\u043f\u0448\u043e\u0442 (40G \u2014 \u044d\u0442\u043e \u043c\u0430\u043a\u0441. \u043e\u0431\u044a\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e<br \/>  # \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043f\u043e\u043a\u0430 \u0441\u043d\u0430\u043f\u0448\u043e\u0442 \u0430\u043a\u0442\u0438\u0432\u0435\u043d). \u041f\u043e\u0442\u043e\u043c \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/font><br \/>  lvcreate -L40G -s -n snap \/dev\/vg0\/root<br \/>  mount \/dev\/vg0\/snap \/mnt -o ro<br \/>  <font color=\"gray\"># \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u0431\u044d\u043a\u0430\u043f \/mnt\/* \u2014 \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u00ab\u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u043e\u0435\u00bb \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/font><br \/>  duplicity\u2026 \/mnt\u2026<br \/>  <font color=\"gray\"># \u041e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u043d\u0430\u043f\u0448\u043e\u0442.<\/font><br \/>  umount \/mnt<br \/>  lvremove -f \/dev\/vg0\/snap<\/p>\n<h5>\u041f\u0430\u043c\u044f\u0442\u043a\u0430 \u0442\u043e\u043c\u0443, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 OpenVZ<\/h5>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 OpenVZ-\u044f\u0434\u0440\u0430\u0445 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 LVM \u2014 \u0442\u043e\u0447\u043d\u0435\u0435, Device Mapper-\u0430 (\u0432 \/boot\/initrd* \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 dm-mod \u0432 conf\/modules). \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OpenVZ \u043f\u043e\u0432\u0435\u0440\u0445 LVM, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 initrd \u043c\u043e\u0434\u0443\u043b\u044f dm-mod (\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043b\u0438-\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438-\u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u043b\u0438), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f OpenVZ \u0432 \u044f\u0434\u0440\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0435\u0441\u0442\u044c \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043d\u043e \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b:<\/p>\n<pre> FILE=`ls \/boot\/initrd.img-*stab* 2&gt;\/dev\/null | head -n 1` if [ &quot;$FILE&quot; == &quot;&quot; ]; then   echo Cannot find an OpenVZ initrd in \/boot. Aborting.   exit 1 fi rm -rf \/tmp\/initrd* 2&gt;\/dev\/null mkdir \/tmp\/initrd cd \/tmp\/initrd zcat $FILE | cpio -i if ! grep &quot;dm-mod&quot; conf\/modules &gt;\/dev\/null; then   echo dm-mod &gt;&gt; conf\/modules   find .\/ | cpio -H newc -o | gzip &gt; \/tmp\/initrd-new   cat \/tmp\/initrd-new &gt; $FILE fi cd \/ rm -rf \/tmp\/initrd* sed -i '   s\/GRUB_DEFAULT=.*\/GRUB_DEFAULT=1\/;   s\/#GRUB_DISABLE_RECOVERY=.*\/GRUB_DISABLE_RECOVERY=true\/;   s\/GRUB_CMDLINE_LINUX=.*\/GRUB_CMDLINE_LINUX=&quot;selinux=no&quot;\/; ' \/etc\/default\/grub update-grub <\/pre>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/176369\/\"> http:\/\/habrahabr.ru\/post\/176369\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/b5b\/908\/7ab\/b5b9087ab097db6bbe79cd3556d05624.jpg\" align=\"left\"\/><br \/>  \u0417\u0430\u0432\u0430\u043b\u044f\u043b\u0430\u0441\u044c \u0443 \u043c\u0435\u043d\u044f \u0442\u0443\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u043a\u0430\u043a \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c LVM \u043d\u0430 \u0434\u0432\u0443\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 dedicated-\u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430\u0445: Hetzner \u0438 ServerLoft. \u041f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0435\u0435 \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>  LVM \u0432 Linux \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0435\u0434\u0438\u043d\u043e\u043c\u043e\u043c\u0435\u043d\u0442\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u00ab\u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u044b\u0435\u00bb \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0431\u044d\u043a\u0430\u043f\u0438\u0442\u044c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445: \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u044d\u043a\u0430\u043f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e rdiff-backup \u0438\u043b\u0438 duplicity (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 FTP-\u0441\u0435\u0440\u0432\u0435\u0440, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043d\u043e\u0433\u0438\u0435 \u0445\u043e\u0441\u0442\u0435\u0440\u044b). \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f RAID-1 (\u0437\u0435\u0440\u043a\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 2 \u0434\u0438\u0441\u043a\u0430\u0445), \u0442\u043e \u043e\u043d\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0434\u0438\u0441\u043a\u043e\u0432 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0443. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c LVM \u043f\u043e\u0432\u0435\u0440\u0445 RAID-1.<\/p>\n<p>  \u041d\u043e \u0431\u0435\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0438 Hetzner, \u043d\u0438 ServerLoft \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c LVM \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u00ab\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u043c\u044b\u0448\u043a\u043c\u00bb. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0438 \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u041e\u0421, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0447\u0442\u043e \u2014 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c RAID-1. \u041d\u0438\u0436\u0435 \u2014 \u0434\u0432\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u00ab\u043d\u0430\u043b\u0438\u0442\u0443\u044e\u00bb \u043c\u0430\u0448\u0438\u043d\u0443 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 LVM \u0434\u043b\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u043f\u043e\u0442\u043e\u043c \u2014 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430\u043c\u0438. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0441 Ubuntu Server 12.04 minimal (\u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u041e\u0421 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-176369","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=176369"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176369\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=176369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=176369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}