[SOLVED] Expand LVM home to root "resize2fs: Operation not permitted While trying to add group #512"
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[root@ValarFarm3 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/VolGroup/lv_root
LV Name lv_root
VG Name VolGroup
LV UUID nGri56-nmWo-ffAA-9YMM-XIFR-Gl6X-CgdT0i
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2019-09-24 18:06:33 -0400
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/VolGroup/lv_home
LV Name lv_home
VG Name VolGroup
LV UUID UdhPD3-7ipt-7GxG-gBtd-HFxd-i0co-E3hd8U
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2019-09-24 18:06:44 -0400
LV Status available
# open 1
LV Size 380.90 GiB
Current LE 97510
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/VolGroup/lv_swap
LV Name lv_swap
VG Name VolGroup
LV UUID 6QT8kq-AvYC-ezTi-506X-r1G2-XTDy-cKV6qn
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2019-09-24 18:08:03 -0400
LV Status available
# open 2
LV Size 15.74 GiB
Current LE 4030
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
now i want to expand home to root size .
##########################
[root@ValarFarm3 ~]# mkfs -t ext4 /dev/mapper/VolGroup-lv_home
mke2fs 1.41.12 (17-May-2010)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
24969216 inodes, 99850240 blocks
4992512 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
3048 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@ValarFarm3 ~]#
[root@ValarFarm3 ~]# resize2fs /dev/VolGroup/lv_home 20G
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/VolGroup/lv_home to 5242880 (4k) blocks.
The filesystem on /dev/VolGroup/lv_home is now 5242880 blocks long.
[root@ValarFarm3 ~]# lvreduce -L 20G /dev/VolGroup/lv_home
WARNING: Reducing active logical volume to 20.00 GiB.
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce VolGroup/lv_home? [y/n]: y
Size of logical volume VolGroup/lv_home changed from 380.90 GiB (97510 extents) to 20.00 GiB (5120 extents).
Logical volume lv_home successfully resized.
[root@ValarFarm3 ~]#
[root@ValarFarm3 ~]# lvreduce -L 20G /dev/VolGroup/lv_home
WARNING: Reducing active logical volume to 20.00 GiB.
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce VolGroup/lv_home? [y/n]: y
Size of logical volume VolGroup/lv_home changed from 380.90 GiB (97510 extents) to 20.00 GiB (5120 extents).
Logical volume lv_home successfully resized.
[root@ValarFarm3 ~]# lvextend -l +100%FREE /dev/mapper/VolGroup-lv_root
Size of logical volume VolGroup/lv_root changed from 50.00 GiB (12800 extents) to 410.90 GiB (105190 extents).
Logical volume lv_root successfully resized.
[root@ValarFarm3 ~]#
[root@ValarFarm3 ~]# resize2fs /dev/mapper/VolGroup-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/VolGroup-lv_root is mounted on /; on-line resizing required
old desc_blocks = 4, new_desc_blocks = 26
Performing an on-line resize of /dev/mapper/VolGroup-lv_root to 107714560 (4k) blocks.
resize2fs: Operation not permitted While trying to add group #512
[root@ValarFarm3 ~]#
CAN someone help me why i have error :
resize2fs: Operation not permitted While trying to add group #512"
I already Did and made a lot of researching before i post my question .
unfortunately i have not found anything can help me .
You can't extend your root filesystem because the data structures required to extend it are too small. One solution is to copy the data to a backup, create a larger filesystem and copy the data back.
Another solution could be to try resizing the filesystem to a size below 410 GiB. For example, start with 100GB. If that works, increase it further until you hit the maximum.
Quote:
im wondering why do we expand size while os is offline ? then whats the benefit of LVM ?
resize2fs is not an LVM command. The problem is not LVM. After all, you resized the logical volume successfully. The problem is the data inside the logical volume, namely the ext filesystem. This allows us to answer the first question: Because an ext filesystem has resizing limits. You may consider this a design flaw.
So the answer to the second question is, first, that LVM allows resizing. It's not LVM's fault that there are flaws in other software. Use XFS instead of ext (but be careful: XFS filesystems can only be extended, not shrunk).
Second, resizing is not LVM's only benefit. Let me point out mirroring and other RAID levels, and logical volumes that are larger than the underlying physical volumes. I am sure we can come up with more benefits.
Last edited by berndbausch; 09-30-2019 at 10:09 AM.
Thank you very much .
i was able to fix it by offline unmount /root and expanding .
but i see a lot of tutorials on internet explain how to expand even root with LVM , not sure why only my case fail .
i even tried with smaller like 50 G or 100 G and failed too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.