{"id":332,"date":"2010-11-15T22:14:00","date_gmt":"2010-11-15T22:14:00","guid":{"rendered":"http:\/\/zensonic.dk\/?p=332"},"modified":"2017-04-09T10:03:43","modified_gmt":"2017-04-09T10:03:43","slug":"about-growing-logical-volumes-md-devices-partitions-and-filesystems-in-ubuntu-10-10","status":"publish","type":"post","link":"https:\/\/zensonic.dk\/?p=332","title":{"rendered":"About growing logical volumes, md devices, partitions and filesystems in Ubuntu 10.10"},"content":{"rendered":"<p>Recently I found myself in a situation, where I was running out of space in my server. Luckily for me, the disks was not 100% utilized. On the positive side, that meant, that I had the possibility to extend my system without buying new hardware. On the negative side it meant that I had to fool around with my precious data. Normally I do this for a living, but on my job it is just customer data. In this case we are talking about pictures of the kids and wife&#8230;.. Much more important stuff for sure <img src='https:\/\/zensonic.dk\/wp-includes\/images\/smilies\/icon_smile.gif' alt=':-)' class='wp-smiley' \/> <\/p>\n<p>So my setup<\/p>\n<ul>\n<li>\/ mounted as an ext3 fs on top of an logical volume (LVM2) called lvroot in vg000<\/li>\n<li>\/boot mount as an ext3 fs directly on \/dev\/md0<\/li>\n<li>vg00 has one physical volume called \/dev\/md1<\/li>\n<li>\/dev\/md0 is a RAID1 device on \/dev\/sda1 and \/dev\/sdb1<\/li>\n<li>\/dev\/md1 is a RAID1 device on \/dev\/sda2 and \/dev\/sdb2<\/li>\n<\/ul>\n<p>Here is the business case: both \/dev\/sda2 and \/dev\/sdb2 was not fully utilized. \/dev\/sdb2 had 67GB unused and \/dev\/sda2 had around 250GB unused. That meant that I could resize \/ with 67GB up front, <strong>for free!<\/strong><\/p>\n<p>I startet out with this situation<\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# df -k \/\r\nFilesystem\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0   1K-blocks\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Used Available Use% Mounted on\r\n\/dev\/mapper\/vg000-root 240149008 232617156\u00c2\u00a0\u00c2\u00a0 2652288\u00c2\u00a0 99% \/<\/pre>\n<p>So how do you do this, in an easy, controlled way, without taking time consuming backups of hundres of GB (I <strong>do<\/strong> make backups, so it is very easy for me to write this <img src='https:\/\/zensonic.dk\/wp-includes\/images\/smilies\/icon_wink.gif' alt=';-)' class='wp-smiley' \/> )? You can do it like I did below.<\/p>\n<p>&lt;DISCLAIMER&gt;This is best-effort, free of charge information.\u00c2\u00a0 If <strong>you<\/strong> end up breaking <strong>your<\/strong> system into several pieces, it is <strong>your<\/strong> responsibility. I can and will not be held liable. <strong>You<\/strong> get to keep the pieces yourself! That will hopefully teach <strong>you<\/strong> not to trust &#8216;expert advice&#8217; from some random internet place run by a random danish guy.&lt;\/DISCLAIMER&gt;<\/p>\n<p>That said. Lets do some storage work<\/p>\n<pre style=\"padding-left: 30px;\"># First I fail \/dev\/sdb2\r\nmdadm --fail \/dev\/md1 \/dev\/sdb2\r\n\r\n# Then I remove \/dev\/sdb2 from the running config\r\nmdadm --remove \/dev\/md1 \/dev\/sdb2<\/pre>\n<pre style=\"padding-left: 30px;\"># Then we delete and recreate \/dev\/sdb2 with a larger size.\r\n# Do a print beforehand to see the \"before\" values\r\nfdisk \/dev\/sdb<\/pre>\n<pre style=\"padding-left: 30px;\">Command (m for help): p\r\n\r\nDisk \/dev\/sdb: 320.1 GB, 320072933376 bytes\r\n255 heads, 63 sectors\/track, 38913 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0xa286eb78\r\n\r\nDevice Boot\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Start\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 End\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Blocks\u00c2\u00a0\u00c2\u00a0 Id\u00c2\u00a0 System\r\n\/dev\/sdb1\u00c2\u00a0\u00c2\u00a0 *\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 26\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 208813+\u00c2\u00a0 fd\u00c2\u00a0 Linux raid autodetect\r\n\/dev\/sdb2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 27\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 30400\u00c2\u00a0\u00c2\u00a0 243979155\u00c2\u00a0\u00c2\u00a0 fd\u00c2\u00a0 Linux raid autodetect<\/pre>\n<pre style=\"padding-left: 30px;\"># delete it<\/pre>\n<pre style=\"padding-left: 30px;\">Command (m for help): d\r\nPartition number (1-4): 2<\/pre>\n<pre style=\"padding-left: 30px;\"># recreate with larger size and same type<\/pre>\n<pre style=\"padding-left: 30px;\">Command (m for help): n\r\nCommand action\r\n e\u00c2\u00a0\u00c2\u00a0 extended\r\n p\u00c2\u00a0\u00c2\u00a0 primary partition (1-4)\r\np\r\nPartition number (1-4): 2\r\nFirst cylinder (27-38913, default 27):\r\nUsing default value 27\r\nLast cylinder, +cylinders or +size{K,M,G} (27-38913, default 38913):\r\nUsing default value 38913<\/pre>\n<pre style=\"padding-left: 30px;\">Command (m for help): t\r\nPartition number (1-4): 2\r\nHex code (type L to list codes): fd\r\nChanged system type of partition 2 to fd (Linux raid autodetect)<\/pre>\n<pre style=\"padding-left: 30px;\"># Write it<\/pre>\n<pre style=\"padding-left: 30px;\">Command (m for help): w<\/pre>\n<p>If you are so lucky that you are not using the device for anything else (ie booting), the kernel can reread the modified partition table on the live system. If the system do use the device for something, you have to reboot the system. Which I had to do. Which I then did&#8230; By issuing the command:<\/p>\n<pre style=\"padding-left: 30px;\">reboot<\/pre>\n<p>When the server came back up, I assembled the \/dev\/md1 device again and waited for a resync. I speeded up the resync quite significantly by issuing the echo commands, which basically just tell md that it has to work as hard as it possibly can.<\/p>\n<pre style=\"padding-left: 30px;\"># Assemble again<\/pre>\n<pre style=\"padding-left: 30px;\">mdadm --add \/dev\/md1 \/dev\/sdb2<\/pre>\n<pre style=\"padding-left: 30px;\"># Speed up rebuild process<\/pre>\n<pre style=\"padding-left: 30px;\">\u00c2\u00a0echo 900000 &gt; \/proc\/sys\/dev\/raid\/speed_limit_min\r\n\u00c2\u00a0echo 900000 &gt; \/proc\/sys\/dev\/raid\/speed_limit_max<\/pre>\n<pre style=\"padding-left: 30px;\"># watch status, eat pizze, drink a beer<\/pre>\n<pre style=\"padding-left: 30px;\">watch cat \/proc\/mdstat<\/pre>\n<p>When the resync was done, I did it all over, replacing \/dev\/sdb2 with \/dev\/sda2.\u00c2\u00a0 After that,\u00c2\u00a0 I had grown the underlying partitions on my two drives, but both md and lvm had not noticed anything.<\/p>\n<p>I made sure everything worked fine\u00c2\u00a0 and went onto the\u00c2\u00a0 next step &#8211; growing an md device on the fly.<\/p>\n<pre style=\"padding-left: 30px;\"># See current md device stats<\/pre>\n<pre style=\"padding-left: 30px;\">root@edison:~# mdadm -D \/dev\/md1\r\n\/dev\/md1:\r\n Version : 00.90\r\n Creation Time : Sat Jul 31 16:45:08 2010\r\n Raid Level : raid1\r\n Array Size : 243979072 (232.68 GiB 249.83 GB)\r\n Used Dev Size : 243979072 (232.68 GiB 249.83 GB)\r\n Raid Devices : 2\r\n Total Devices : 2\r\nPreferred Minor : 1\r\n Persistence : Superblock is persistent\r\n\r\n Update Time : Mon Nov 15 20:16:27 2010\r\n State : clean\r\n Active Devices : 2\r\nWorking Devices : 2\r\n Failed Devices : 0\r\n Spare Devices : 0\r\n\r\n UUID : f510bad0:59d990c1:19dfcc76:62eb3300\r\n Events : 0.204498\r\n\r\n Number\u00c2\u00a0\u00c2\u00a0 Major\u00c2\u00a0\u00c2\u00a0 Minor\u00c2\u00a0\u00c2\u00a0 RaidDevice State\r\n 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 8\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 active sync\u00c2\u00a0\u00c2\u00a0 \/dev\/sda2\r\n 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 8\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 18\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 active sync\u00c2\u00a0\u00c2\u00a0 \/dev\/sdb2\r\n\r\n# Grow the device to the max - took about 1-2 seconds, but see below\r\nroot@edison:~#\u00c2\u00a0 mdadm --grow --size=max \/dev\/md1<\/pre>\n<pre style=\"padding-left: 30px;\"># Recheck the device stat.<\/pre>\n<pre style=\"padding-left: 30px;\">root@edison:~# mdadm -D \/dev\/md1\r\n\/dev\/md1:\r\n Version : 00.90\r\n Creation Time : Sat Jul 31 16:45:08 2010\r\n Raid Level : raid1\r\n Array Size : 312359744 (297.89 GiB 319.86 GB)\r\n Used Dev Size : 312359744 (297.89 GiB 319.86 GB)\r\n Raid Devices : 2\r\n Total Devices : 2\r\nPreferred Minor : 1\r\n Persistence : Superblock is persistent\r\n\r\n Update Time : Mon Nov 15 20:17:21 2010\r\n State : active, <span style=\"color: #ff0000;\">resyncing<\/span>\r\n Active Devices : 2\r\nWorking Devices : 2\r\n Failed Devices : 0\r\n Spare Devices : 0\r\n\r\n<span style=\"color: #ff0000;\"> Rebuild Status : 78% complete<\/span>\r\n\r\n UUID : f510bad0:59d990c1:19dfcc76:62eb3300\r\n Events : 0.204503\r\n\r\n Number\u00c2\u00a0\u00c2\u00a0 Major\u00c2\u00a0\u00c2\u00a0 Minor\u00c2\u00a0\u00c2\u00a0 RaidDevice State\r\n 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 8\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 active sync\u00c2\u00a0\u00c2\u00a0 \/dev\/sda2\r\n 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 8\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 18\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 active sync\u00c2\u00a0\u00c2\u00a0 \/dev\/sdb2<\/pre>\n<p>Notice how the drive went into sync state. Looking at mdstat confirms that. You can use the device before the mirroring is done. &#8230; or you can play it safe and wait. I decided to go ahead and use it before the sync was done. Living on the edge &#8230; this is not work. Only something your wife will never forgive you for <img src='https:\/\/zensonic.dk\/wp-includes\/images\/smilies\/icon_wink.gif' alt=';-)' class='wp-smiley' \/> <\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# cat \/proc\/mdstat\r\nPersonalities : [linear] [multipath] [raid0] [raid1]\r\n[raid6] [raid5] [raid4] [raid10]\r\n\r\nmd1 : active raid1 sda2[0] sdb2[1]\r\n\u00c2\u00a0312359744 blocks [2\/2] [UU]\r\n\u00c2\u00a0[===============&gt;.....]\u00c2\u00a0 resync = 78.6% (245745600\/312359744)\r\nfinish=21.2min speed=52265K\/sec\r\n\r\nmd0 : active raid1 sdb1[1] sda1[0]\r\n\u00c2\u00a0208704 blocks [2\/2] [UU]\r\nunused devices: &lt;none&gt;<\/pre>\n<p>Next step. Making lvm aware of the change. Quite easy actually:<\/p>\n<pre style=\"padding-left: 30px;\"># Before\r\nroot@edison:~# pvdisplay \/dev\/md\r\n\u00c2\u00a0--- Physical volume ---\r\n\u00c2\u00a0PV Name\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \/dev\/md1\r\n\u00c2\u00a0VG Name\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 vg000\r\n\u00c2\u00a0PV Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 232,68 GiB \/ not usable 832,00 KiB\r\n\u00c2\u00a0Allocatable\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 yes (but full)\r\n\u00c2\u00a0PE Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 4,00 MiB\r\n\u00c2\u00a0Total PE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 59565\r\n\u00c2\u00a0Free PE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\r\n\u00c2\u00a0Allocated PE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 59565\r\n\u00c2\u00a0PV UUID\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 saiFOT-Dw2O-OnVv-rA4b-wZG3-OQHN-fFD1w<\/pre>\n<p>You then issue an pvresize on the pv\u00c2\u00a0 like this<\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# pvresize \/dev\/md1\r\n\u00c2\u00a0Physical volume \"\/dev\/md1\" changed\r\n\u00c2\u00a01 physical volume(s) resized \/ 0 physical volume(s) not resized<\/pre>\n<p>And you end up with<\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# pvdisplay \/dev\/md1\r\n --- Physical volume ---\r\n PV Name\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \/dev\/md1\r\n VG Name\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 vg000\r\n PV Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 297,89 GiB \/ not usable 2,62 MiB\r\n Allocatable\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 yes\r\n PE Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 4,00 MiB\r\n Total PE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 76259\r\n Free PE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 16694\r\n Allocated PE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 59565\r\n PV UUID\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 saiFOT-Dw2O-OnVv-rA4b-wZG3-OQHN-fFD1wI<\/pre>\n<p>We are getting there? Now onto extending the volume. First peek at the current sizes\/free space<\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# vgdisplay vg000\r\n --- Volume group ---\r\n VG Name\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 vg000\r\n System ID\r\n Format\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 lvm2\r\n Metadata Areas\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n Metadata Sequence No\u00c2\u00a0 4\r\n VG Access\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 read\/write\r\n VG Status\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 resizable\r\n MAX LV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\r\n Cur LV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n Open LV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n Max PV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\r\n Cur PV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n Act PV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n VG Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 297,89 GiB\r\n PE Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 4,00 MiB\r\n Total PE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 76259\r\n Alloc PE \/ Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 59565 \/ 232,68 GiB\r\n Free\u00c2\u00a0 PE \/ Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 16694 \/ 65,21 GiB\r\n VG UUID\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 rL7lfw-H2FC-4ala-KVV3-bLIA-MbA9-co2n1O<\/pre>\n<pre style=\"padding-left: 30px;\">root@edison:~# lvdisplay \/dev\/vg000\/root\r\n --- Logical volume ---\r\n LV Name\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \/dev\/vg000\/root\r\n VG Name\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 vg000\r\n LV UUID\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 uDPn6b-AvyO-xH2n-zpXm-n0Xt-5g5n-aSdu4C\r\n LV Write Access\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 read\/write\r\n LV Status\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 available\r\n # open\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n LV Size\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 232,68 GiB\r\n Current LE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 59565\r\n Segments\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n Allocation\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 inherit\r\n Read ahead sectors\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 auto\r\n - currently set to\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 256\r\n Block device\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 251:0<\/pre>\n<p>Then extend the volume<\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# lvextend -l 76259 \/dev\/vg000\/root\r\nExtending logical volume root to 297,89 GiB\r\nLogical volume root successfully resized<\/pre>\n<p>One step left &#8211; resize the live filesystem<\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# resize2fs \/dev\/vg000\/root\r\nresize2fs 1.41.12 (17-May-2010)\r\nFilesystem at \/dev\/vg000\/root is mounted on \/; on-line resizing required\r\nold desc_blocks = 15, new_desc_blocks = 19\r\nPerforming an on-line resize of \/dev\/vg000\/root to 78089216 (4k) blocks.\r\nThe filesystem on \/dev\/vg000\/root is now 78089216 blocks long.<\/pre>\n<p>How much did I gain:<\/p>\n<pre style=\"padding-left: 30px;\">root@edison:~# df -k \/\r\nFilesystem\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0   \u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1K-blocks\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Used Available Use% Mounted on\r\n\/dev\/mapper\/vg000-root  307454080 232621080\u00c2\u00a0 68588172\u00c2\u00a0 78% \/<\/pre>\n<p>Almost a walk in the park. I did actully run into a problem during this procedure. When I removed \/dev\/sdb2, grub would not reboot. Instead it gave me a grub rescue prompt.\u00c2\u00a0 I overcame this booting a rescue CD, starting up the system using that. I then added \/dev\/sdb2 into \/dev\/md1 from the rescue cd, waited for the mirroring and and rebooted again. When I did the same for \/dev\/sda2, grub was happy all along?! I have not bothered to figure out why grub misbehaved, I just put grub down as being like a teenager: unreliable and causing problems for no obvious reason <img src='https:\/\/zensonic.dk\/wp-includes\/images\/smilies\/icon_wink.gif' alt=';-)' class='wp-smiley' \/> <\/p>\n<p style=\"padding-left: 30px;\">\n","protected":false},"excerpt":{"rendered":"<p>Recently I found myself in a situation, where I was running out of space in my server. Luckily for me, the disks was not 100% utilized. On the positive side, that meant, that I had the possibility to extend my system without buying new hardware. On the negative side it meant that I had to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,19,5,6,11],"tags":[],"class_list":["post-332","post","type-post","status-publish","format-standard","hentry","category-linux","category-linux-lvm","category-personal-ramblings","category-unix","category-volume-managers"],"_links":{"self":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/posts\/332"}],"collection":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=332"}],"version-history":[{"count":0,"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/posts\/332\/revisions"}],"wp:attachment":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}