LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-30-2019, 04:41 AM   #1
dr.x
Member
 
Registered: Jan 2013
Posts: 231

Rep: Reputation: Disabled
Expand LVM home to root "resize2fs: Operation not permitted While trying to add group #512"


hello Folks ,

i have fresh centos 6.10 64 bits .
#############

[root@ValarFarm3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
50G 14G 33G 30% /
tmpfs 16G 0 16G 0% /dev/shm
/dev/sda1 477M 79M 369M 18% /boot
/dev/mapper/VolGroup-lv_home
375G 67M 356G 1% /home
[root@ValarFarm3 ~]#




[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 .
##########################

umount /home
mkfs -t ext4 /dev/mapper/VolGroup-lv_home


[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

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
done

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 ~]# e2fsck -f /dev/VolGroup/lv_home
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VolGroup/lv_home: 11/24969216 files (0.0% non-contiguous), 1616871/99850240 blocks
[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"

???


THANKS
 
Old 09-30-2019, 05:25 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Just search for the literal error message, minus the "#512". This Serverfault answer provides a good explanation: https://serverfault.com/questions/81...g-to-add-group.
 
Old 09-30-2019, 08:38 AM   #3
dr.x
Member
 
Registered: Jan 2013
Posts: 231

Original Poster
Rep: Reputation: Disabled
I already Did and made a lot of researching before i post my question .
unfortunately i have not found anything can help me .

i even followed your links you provided , Thanks a lot for sharing , but still im on same problem .

im wondering why do we expand size while os is offline ? then whats the benefit of LVM ?


Thanks
 
Old 09-30-2019, 10:07 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by dr.x View Post
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.
 
1 members found this post helpful.
Old 10-01-2019, 06:49 AM   #5
dr.x
Member
 
Registered: Jan 2013
Posts: 231

Original Poster
Rep: Reputation: Disabled
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.

Thanks again i appreciate your answer and time .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant expand root partition LVM |resize2fs: Operation not permitted While trying to add group #512 dr.x Linux - Server 9 07-18-2019 10:01 PM
SIOCSIFFLAGS: Operation not permitted SIOCSIFFLAGS: Operation not permitted sushan1982 Linux - Wireless Networking 1 01-01-2012 08:04 PM
Online resize2fs: Operation not permitted While trying to add group #14080 JubJub Linux - Software 3 08-30-2010 08:23 AM
resize2fs: No space left on device While trying to add group #6 the green one Linux - Newbie 1 09-30-2009 08:05 AM
resize2fs: No space left on device While trying to add group #4 mahe_25 Linux - Newbie 3 02-17-2008 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration