Editing
LVM+DRBD+LVM+KVM+LVM Resize
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Resize GUEST lvm disk == <source> pvs PV VG Fmt Attr PSize PFree /dev/vda2 vg_hopmon lvm2 a-- 7.51g 36.00m </source> <source> fdisk -u -l /dev/vda Disk /dev/vda: 10.7 GB, 10737418240 bytes 16 heads, 63 sectors/track, 20805 cylinders, total 20971520 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000d51fa Device Boot Start End Blocks Id System /dev/vda1 * 2048 1026047 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/vda2 1026048 16777215 7875584 8e Linux LVM </source> * notice the start boundary '''1026048''' * You will use this after you delete the parition in the next step <source> fdisk -u /dev/vda Command (m for help): d Partition number (1-4): 2 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 ### This is where you enter in your start boundary from before First sector (63-20971519, default 63): 1026048 Last sector, +sectors or +size{K,M,G} (1026048-20971519, default 20971519): Using default value 20971519 Command (m for help): t Hex code (type L to list codes): 8e Changed system type of partition 2 to 8e (Linux LVM) Command (m for help): p Disk /dev/vda: 10.7 GB, 10737418240 bytes 16 heads, 63 sectors/track, 20805 cylinders, total 20971520 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000d51fa Device Boot Start End Blocks Id System /dev/vda1 * 2048 1026047 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/vda2 1026048 20971519 9972736 8e Linux LVM Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. </source> * You can try to run 'partprobe' to re-read the disk partitions.. but it may not work * If partprobe fails you will have to reboot to allow the partition size to be apply. You can '''reboot''' this time. <source> pvs PV VG Fmt Attr PSize PFree /dev/vda2 vg_hopmon lvm2 a-- 7.51g 36.00m </source> <source> pvresize /dev/vda2 Physical volume "/dev/vda2" changed 1 physical volume(s) resized / 0 physical volume(s) not resized </source> <source> pvs PV VG Fmt Attr PSize PFree /dev/vda2 vg_hopmon lvm2 a-- 9.51g 2.04g </source> * Now can extend the LV <source> lvscan ACTIVE '/dev/vg_hopmon/lv_root' [5.47 GiB] inherit ACTIVE '/dev/vg_hopmon/lv_swap' [2.00 GiB] inherit </source> <source> lvresize -L+2GB /dev/vg_hopmon/lv_root Extending logical volume lv_root to 7.47 GiB Logical volume lv_root successfully resized </source> <source> lvscan ACTIVE '/dev/vg_hopmon/lv_root' [7.47 GiB] inherit ACTIVE '/dev/vg_hopmon/lv_swap' [2.00 GiB] inherit </source> * Resize the filesystem <source> df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_hopmon-lv_root 5.4G 4.8G 422M 92% / </source> <source> resize2fs /dev/mapper/vg_hopmon-lv_root resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/mapper/vg_hopmon-lv_root is mounted on /; on-line resizing required old desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mapper/vg_hopmon-lv_root to 1958912 (4k) blocks. The filesystem on /dev/mapper/vg_hopmon-lv_root is now 1958912 blocks long. </source> <source> df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_hopmon-lv_root 7.4G 4.8G 2.3G 68% / </source>
Summary:
Please note that all contributions to RARForge may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RARForge:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home
All Pages
All Files
View Categories
Recent changes
Random page
Edit this menu
Tools
What links here
Related changes
Special pages
Page information