<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LVM lvreduce nightmare in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/lvm-lvreduce-nightmare/m-p/5661977#M53678</link>
    <description>&lt;P&gt;Too bad you did not include the output of the commands you ran.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your &lt;STRONG&gt;resize2fs /dev/vg0/data 100G &lt;/STRONG&gt;command does not say "shrink this filesystem by 100G": it says "make this filesystem exactly 100G in size". It should have told you "&lt;FONT face="courier new,courier"&gt;resizefs: New size smaller than minimum&lt;/FONT&gt;", which means it noticed you're trying to shrink the filesystem to smaller size than the data it contains and stopped without doing anything.&lt;/P&gt;&lt;P&gt;(You should have used something like &lt;FONT face="courier new,courier"&gt;resize2fs /dev/vg0/data 2.1T&lt;FONT face="arial,helvetica,sans-serif"&gt; instead.)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, your &lt;STRONG&gt;lvreduce -L -100G -n /dev/vg0/data&lt;/STRONG&gt; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Restoring the VG configuration backup is *exactly* what you should do at this point.&lt;/P&gt;&lt;P&gt;First, confirm that you're looking at the correct VG configuration file, by running this command:&lt;/P&gt;&lt;PRE&gt;vgcfgrestore -l vg0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;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:&lt;/P&gt;&lt;P&gt;"Created *before* executing 'lvreduce -L -100G -n /dev/vg0/data'".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you're sure you have the correct backup file, you can restore the VG configuration with a command like this:&lt;/P&gt;&lt;PRE&gt;vgcfgrestore -f /etc/lvm/archive/vg0_00008-1147866134.vg vg0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the filesystem has not been damaged by your e2fsck attempts, it should be exactly as it was before your unfortunate lvreduce operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
    <pubDate>Fri, 18 May 2012 13:00:22 GMT</pubDate>
    <dc:creator>Matti_Kurkela</dc:creator>
    <dc:date>2012-05-18T13:00:22Z</dc:date>
    <item>
      <title>LVM lvreduce nightmare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/lvm-lvreduce-nightmare/m-p/5660093#M53674</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;I tried to reduce the VG vg0 and this is what it looked like before I tried to reduce it&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Filesystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&amp;nbsp; Used Avail&amp;nbsp;&amp;nbsp; Use% Mounted on&lt;BR /&gt;/dev/mapper/vg0-data &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.2T&amp;nbsp; 1.7T&amp;nbsp; 433G&amp;nbsp; 80%&amp;nbsp; /data&lt;/DIV&gt;&lt;DIV&gt;Out of the available&amp;nbsp;&lt;STRONG&gt;433G&lt;/STRONG&gt;&amp;nbsp;I wanted to reduce&amp;nbsp;&lt;STRONG&gt;100G&lt;/STRONG&gt;&amp;nbsp;in vg0 so that I could use it for a new partition and this is what I did ..&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;e2fsck -f /dev/vg0/data&lt;BR /&gt;resize2fs /dev/vg0/data 100G&lt;BR /&gt;lvreduce -L -100G -n /dev/vg0/data&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;lvs&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; LV &amp;nbsp; VG &amp;nbsp; Attr &amp;nbsp; LSize Origin Snap% &amp;nbsp;Move Log Copy% &amp;nbsp;Convert&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; data vg0 &amp;nbsp;-wi-ao 2.08T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;after the lvreduce it did what I intended to as you can see in&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;vgs&lt;BR /&gt;&amp;nbsp; VG&amp;nbsp;&amp;nbsp; #PV #LV #SN Attr&amp;nbsp;&amp;nbsp; VSize VFree&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; vg0&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 0 wz--n- 2.18T&amp;nbsp;&lt;STRONG&gt;100.00G&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; ( it did allocate the 100.00G as free space )&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;after I mounted /data back , I could even touch a file , however when we start the app (mysql) and when it tries to write into the existing data in /data , the drive goes into&amp;nbsp;&lt;STRONG&gt;read only mode repeatedly&lt;/STRONG&gt;&amp;nbsp;..&lt;/DIV&gt;&lt;DIV&gt;in order to fix it i unmounted /data and ran&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;e2fsck -f /dev/vg0/data -n&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;after the fsck completed it would prompt to fix superblock/inodes which I replied with 'yes' however the problem still persists that if i mount /data it goes into read-only mode .&lt;/DIV&gt;&lt;DIV&gt;some info &amp;nbsp;about the server setup&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;dmsetup table&lt;/DIV&gt;&lt;DIV&gt;vg0-data: 0 4477255680 linear 104:17 384&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Red Hat Enterprise Linux Server release 5.7&lt;/DIV&gt;&lt;DIV&gt;2.6.18-274.17.1.el5 #1 SMP &amp;nbsp;x86_64&lt;/DIV&gt;&lt;DIV&gt;lvm2-2.02.84-6.el5_7.1&lt;/DIV&gt;&lt;DIV&gt;I have reduced lvm's with those &amp;nbsp;sequence of commands in the past but i just dont understand why it seems to have failed this time although i did get 100G free space in vg0 but the partition /data seems useless ..&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;I would greatly appreciate any help/insights .. i notice lvm has created a backup file in&amp;nbsp;/etc/lvm/archive as&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A target="_blank" href="http://vg0_00008-1147866134.vg/"&gt;vg0_00008-1147866134.vg&lt;/A&gt;&amp;nbsp;, does restoring from that file actually work ? will it get the drive into original state ? and how can i actually free some space from the volume group if i want to ?&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;########&lt;/DIV&gt;&lt;DIV&gt;some errors spewed in dmesg&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;attempt to access beyond end of device&lt;/DIV&gt;&lt;DIV&gt;dm-0: rw=0, want=4654102632, limit=4477255680&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0): read_block_bitmap: Cannot read block bitmap - block_group = 17145, block_bitmap = 561807360&lt;/DIV&gt;&lt;DIV&gt;Aborting journal on device dm-0.&lt;/DIV&gt;&lt;DIV&gt;attempt to access beyond end of device&lt;/DIV&gt;&lt;DIV&gt;dm-0: rw=0, want=4565762056, limit=4477255680&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0): read_block_bitmap: &amp;lt;2&amp;gt;ext3_abort called.&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0): ext3_journal_start_sb: Detected aborted journal&lt;/DIV&gt;&lt;DIV&gt;Cannot read block bitmap - block_group = 17417, block_bitmap = 570720256&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0): read_block_bitmap: Cannot read block bitmap - block_group = 17417, block_bitmap = 570720256&lt;/DIV&gt;&lt;DIV&gt;dm-0: rw=0, want=4683202568, limit=4477255680&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0): read_block_bitmap: Cannot read block bitmap - block_group = 17865, block_bitmap = 585400320&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0) in ext3_free_blocks_sb: Journal has aborted&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0) in ext3_orphan_del: Journal has aborted&lt;/DIV&gt;&lt;DIV&gt;__journal_remove_journal_head: freeing b_committed_data&lt;/DIV&gt;&lt;DIV&gt;ext3_abort called.&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0): ext3_put_super: Couldn't clean up the journal&lt;/DIV&gt;&lt;DIV&gt;kjournald starting. &amp;nbsp;Commit interval 5 seconds&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs warning (device dm-0): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs warning (device dm-0): ext3_clear_journal_err: Marking fs in need of filesystem check.&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs warning: mounting fs with errors, running e2fsck is recommended&lt;/DIV&gt;&lt;DIV&gt;attempt to access beyond end of device&lt;/DIV&gt;&lt;DIV&gt;dm-0: rw=0, want=4654102632, limit=4477255680&lt;/DIV&gt;&lt;DIV&gt;EXT3-fs error (device dm-0): read_block_bitmap: Cannot read block bitmap - block_group = 17145, block_bitmap = 561807360&lt;/DIV&gt;&lt;DIV&gt;Aborting journal on device dm-0.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 May 2012 21:06:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/lvm-lvreduce-nightmare/m-p/5660093#M53674</guid>
      <dc:creator>ganaiwali</dc:creator>
      <dc:date>2012-05-16T21:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: LVM lvreduce nightmare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/lvm-lvreduce-nightmare/m-p/5661977#M53678</link>
      <description>&lt;P&gt;Too bad you did not include the output of the commands you ran.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your &lt;STRONG&gt;resize2fs /dev/vg0/data 100G &lt;/STRONG&gt;command does not say "shrink this filesystem by 100G": it says "make this filesystem exactly 100G in size". It should have told you "&lt;FONT face="courier new,courier"&gt;resizefs: New size smaller than minimum&lt;/FONT&gt;", which means it noticed you're trying to shrink the filesystem to smaller size than the data it contains and stopped without doing anything.&lt;/P&gt;&lt;P&gt;(You should have used something like &lt;FONT face="courier new,courier"&gt;resize2fs /dev/vg0/data 2.1T&lt;FONT face="arial,helvetica,sans-serif"&gt; instead.)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, your &lt;STRONG&gt;lvreduce -L -100G -n /dev/vg0/data&lt;/STRONG&gt; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Restoring the VG configuration backup is *exactly* what you should do at this point.&lt;/P&gt;&lt;P&gt;First, confirm that you're looking at the correct VG configuration file, by running this command:&lt;/P&gt;&lt;PRE&gt;vgcfgrestore -l vg0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;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:&lt;/P&gt;&lt;P&gt;"Created *before* executing 'lvreduce -L -100G -n /dev/vg0/data'".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you're sure you have the correct backup file, you can restore the VG configuration with a command like this:&lt;/P&gt;&lt;PRE&gt;vgcfgrestore -f /etc/lvm/archive/vg0_00008-1147866134.vg vg0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the filesystem has not been damaged by your e2fsck attempts, it should be exactly as it was before your unfortunate lvreduce operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2012 13:00:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/lvm-lvreduce-nightmare/m-p/5661977#M53678</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2012-05-18T13:00:22Z</dc:date>
    </item>
  </channel>
</rss>

