{"id":816,"date":"2014-08-26T12:30:01","date_gmt":"2014-08-26T12:30:01","guid":{"rendered":"http:\/\/10sa.com\/sql_stories\/?p=816"},"modified":"2014-08-26T12:31:56","modified_gmt":"2014-08-26T12:31:56","slug":"proxmox-customization","status":"publish","type":"post","link":"http:\/\/10sa.com\/sql_stories\/?p=816","title":{"rendered":"Proxmox customization"},"content":{"rendered":"<p>How to change default settings and make software raid (mirror and stripe) with GPT.<\/p>\n<p>While booting installation:<\/p>\n<pre lang=\"bash\">\r\nlinux ext4 hdsize=10 maxroot=5 swapsize=1 maxvz=1\r\n<\/pre>\n<p><a href=\"http:\/\/www.jamescoyle.net\/how-to\/261-proxmox-advanced-install-settings\">http:\/\/www.jamescoyle.net\/how-to\/261-proxmox-advanced-install-settings<\/a><\/p>\n<p>In case your partitions were used with raid you should wipe them (dry :]):<\/p>\n<pre lang=\"bash\">\r\nwipefs -a \/dev\/sdb1\r\n# or mdadm --zero-superblock \/dev\/sdb[1-4]\r\n<\/pre>\n<pre lang=\"bash\">\r\napt-get -y update\r\napt-get -y dist-upgrade\r\nSTART_AT=`parted \/dev\/sda p | tail -n 2 | head -n 1 | awk -F \" \" '{print $3}'`\r\nparted \/dev\/sda mkpart primary $START_AT 100% \r\napt-get install xfsprogs -y\r\napt-get -y install mdadm\r\n\r\nsgdisk -b=\/tmp\/partitions \/dev\/sda\r\nsgdisk -l=\/tmp\/partitions \/dev\/sdb\r\n\r\ndd if=\/dev\/sda1 of=\/dev\/sdb1\r\nsgdisk -t 2:fd00 \/dev\/sdb\r\nsgdisk -t 3:fd00 \/dev\/sdb\r\nsgdisk -t 4:fd00 \/dev\/sdb\r\nsgdisk -t 4:fd00 \/dev\/sda\r\n\r\n# To create a \"degraded\" array in which some devices are missing, simply give the word \"missing\" in \r\n# place of a device name.  This will cause mdadm to leave the corresponding slot in the array empty.\r\n# For a RAID4 or RAID5 array at most one slot can be \"missing\"; for a RAID6 array at most two slots.  # For a RAID1 array, only one real device needs to be given.  All of the others can be \"missing\".\r\nyes | mdadm --create \/dev\/md0 --level=1 --raid-disks=2 missing \/dev\/sdb2\r\nyes | mdadm --create \/dev\/md1 --level=1 --raid-disks=2 missing \/dev\/sdb3\r\nyes | mdadm --create \/dev\/md2 --level=0 --raid-disks=2 --chunk=256 \/dev\/sda4 \/dev\/sdb4\r\n\/usr\/share\/mdadm\/mkconf > \/etc\/mdadm\/mdadm.conf\r\nmkfs.ext4 \/dev\/md0\r\nmkfs.ext4 \/dev\/md1\r\n# xfsprogs and the mkfs.xfs utility automatically select the best stripe size and stripe width for underlying devices that support it, such as Linux software RAID devices.\r\nmkfs.xfs -f \/dev\/md2\r\nmkdir \/mnt\/md0\r\nmount \/dev\/md0 \/mnt\/md0\r\ncp -ax \/boot\/* \/mnt\/md0\r\nsed -i  's\/UUID=.*\\s\\\/boot\/\\\/dev\\\/md0 \\\/boot\/' \/etc\/fstab\r\nreboot\r\n<\/pre>\n<p>After reboot<\/p>\n<pre lang=\"bash\">\r\necho 'GRUB_DISABLE_LINUX_UUID=true' >> \/etc\/default\/grub\r\necho 'GRUB_PRELOAD_MODULES=\"raid dmraid\"' >> \/etc\/default\/grub\r\necho raid1 >> \/etc\/modules\r\necho raid1 >> \/etc\/initramfs-tools\/modules\r\ngrub-install \/dev\/sda --recheck\r\ngrub-install \/dev\/sdb --recheck\r\nupdate-grub\r\nupdate-initramfs -u\r\n\r\nsgdisk -t 2:fd00 \/dev\/sda\r\nmdadm --add \/dev\/md0 \/dev\/sda2\r\n\r\npvcreate \/dev\/md1\r\nvgextend pve \/dev\/md1\r\npvmove \/dev\/sda3 \/dev\/md1\r\nvgreduce pve \/dev\/sda3\r\npvremove \/dev\/sda3\r\nsgdisk -t 3:fd00 \/dev\/sda\r\nmdadm --add \/dev\/md1 \/dev\/sda3\r\n\r\n# voila...\r\nlsblk -o NAME,MAJ:MIN,RM,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUID\r\n<\/pre>\n<p>Sources:<br \/>\n<a href=\"http:\/\/www.anchor.com.au\/blog\/2012\/10\/the-difference-between-booting-mbr-and-gpt-with-grub\/\">http:\/\/www.anchor.com.au\/blog\/2012\/10\/the-difference-between-booting-mbr-and-gpt-with-grub\/<\/a><br \/>\n<a href=\"http:\/\/alexunil.net\/2013\/09\/12\/proxmox-3-1-auf-softraid-mit-gpt\/\">http:\/\/alexunil.net\/2013\/09\/12\/proxmox-3-1-auf-softraid-mit-gpt\/<\/a><br \/>\n<a href=\"http:\/\/boffblog.wordpress.com\/2013\/08\/22\/how-to-install-proxmox-ve-3-0-on-software-raid\/\">http:\/\/boffblog.wordpress.com\/2013\/08\/22\/how-to-install-proxmox-ve-3-0-on-software-raid\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to change default settings and make software raid (mirror and stripe) with GPT. While booting installation: linux ext4 hdsize=10 maxroot=5 swapsize=1 maxvz=1 http:\/\/www.jamescoyle.net\/how-to\/261-proxmox-advanced-install-settings In case your partitions were used with raid you should wipe them (dry :]): wipefs -a \/dev\/sdb1 # or mdadm &#8211;zero-superblock \/dev\/sdb[1-4] apt-get -y update apt-get -y dist-upgrade START_AT=`parted \/dev\/sda p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/816"}],"collection":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=816"}],"version-history":[{"count":17,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/816\/revisions"}],"predecessor-version":[{"id":887,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/816\/revisions\/887"}],"wp:attachment":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=816"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}