- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- LVM lvreduce nightmare
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2012 02:06 PM
05-16-2012 02:06 PM
LVM lvreduce nightmare
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg0-data 2.2T 1.7T 433G 80% /data
e2fsck -f /dev/vg0/data
resize2fs /dev/vg0/data 100G
lvreduce -L -100G -n /dev/vg0/data
vgs
VG #PV #LV #SN Attr VSize VFree
vg0 1 1 0 wz--n- 2.18T 100.00G ( it did allocate the 100.00G as free space )
- Tags:
- lvreduce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2012 06:00 AM
05-18-2012 06:00 AM
Re: LVM lvreduce nightmare
Too bad you did not include the output of the commands you ran.
Your resize2fs /dev/vg0/data 100G command does not say "shrink this filesystem by 100G": it says "make this filesystem exactly 100G in size". It should have told you "resizefs: New size smaller than minimum", which means it noticed you're trying to shrink the filesystem to smaller size than the data it contains and stopped without doing anything.
(You should have used something like resize2fs /dev/vg0/data 2.1T instead.)
Unfortunately, your lvreduce -L -100G -n /dev/vg0/data command did exactly what you told it to do: "make this LV 100G smaller than it currently is". The "attempt to access beyond end of device" messages in the syslog confirm that this part of the procedure was completed without shrinking the filesystem successfully first. Now the filesystem metadata says the filesystem is larger than the LV. When the filesysten driver tries to access some parts of the filesystem, the LVM rejects those operations.
Restoring the VG configuration backup is *exactly* what you should do at this point.
First, confirm that you're looking at the correct VG configuration file, by running this command:
vgcfgrestore -l vg0
It will list all the available VG configuration backups for the vg0 VG, their creation timestamps and a description of the context the backup was created in. You'll want the backup which has a description:
"Created *before* executing 'lvreduce -L -100G -n /dev/vg0/data'".
Once you're sure you have the correct backup file, you can restore the VG configuration with a command like this:
vgcfgrestore -f /etc/lvm/archive/vg0_00008-1147866134.vg vg0
If the filesystem has not been damaged by your e2fsck attempts, it should be exactly as it was before your unfortunate lvreduce operation.
Lesson learned: when doing a critical multi-step operation like shrinking a filesystem, always make sure you understand all the messages displayed by the previous step before proceeding to the next step. If you're uncertain whether the previous step completed successfully or not, check it before going any further.
In this case, you could have mounted the filesystem after the resize2fs command and run "df -h". It would have told you the filesystem size was still 2.2T, instead of the expected 2.1T value.
- Tags:
- vgcfgrestore