LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 09-12-2018, 03:43 PM   #1
rtoney5
Member
 
Registered: Oct 2007
Location: FL, US
Distribution: Ubuntu MintLinux, ChromeOS, Parted Magic, PCOS OpenWorkstation, OpenSuse-11
Posts: 138

Rep: Reputation: 24
How I fixed My my lv(logical volume) was corrupted.: ls -hl error, /dev/sdb1: read failed after 0 of 512 at 54010904576: Input/output error


The error below was occuring in my LVM setup when trying to list certain directories. Basically my lv(logical volume) was corrupted...:
/dev/sdb1: read failed after 0 of 512 at 54010904576: Input/output error

I used a combination of the commands below for my lvm setup to restore and fix the corrupted lv(logical volume) in my Volume Group Below. The source of the fix came from a combination if you read the two Web links below in order.
The line numbers in front of the commands are listed because of the output of the history command. Figured i'd share this with folks that may run into a Corrupt lv(logical volume) Issue. Although the fsck -fy command below took a few hours, it was worth it. The alternative was the /etc/lvm/archive method of restoring the structure of my lvm, but I had lost a write up of documenttion how I restored my lvm on a different machine. I didn't feel like searching all over for it so i used the method below. { the /etc/lvm/archive method is more heavy lifting if you deleted one of your lv's (logical volumes) in error }.

Commands below are what I Used to fix the Corrupted lv (logical volume) which displayed an error in the title of this Post...:

399 sudo vgscan
405 sudo lvchange -an /dev/Super-LVM-QuietGaragePC-Ver1-VG/MyQuietGaragePC-Pool-id-1-LV
406 sudo vgchange -an /dev/Super-LVM-QuietGaragePC-Ver1-VG
407 sudo vgscan
408 sudo vgchange -ay /dev/Super-LVM-QuietGaragePC-Ver1-VG
409 sudo lvscan
410 sudo lvchange -ay /dev/Super-LVM-QuietGaragePC-Ver1-VG/MyQuietGaragePC-Pool-id-1-LV
411 sudo lvchange -an /dev/Super-LVM-QuietGaragePC-Ver1-VG/MyQuietGaragePC-Pool-id-1-LV
412 sudo lvchange --refresh /dev/Super-LVM-QuietGaragePC-Ver1-VG/MyQuietGaragePC-Pool-id-1-LV
413 sudo lvscan
414 sudo lvchange -ay /dev/Super-LVM-QuietGaragePC-Ver1-VG/MyQuietGaragePC-Pool-id-1-LV

416 sudo ./Gar*lvm ( this is a script i use just to mount my lvm)
422 sudo umount /media/Gar*
423 sudo lvchange -ay /dev/Super-LVM-QuietGaragePC-Ver1-VG/MyQuietGaragePC-Pool-id-1-LV
424 sudo lvchange -ay /dev/Super-LVM-QuietGaragePC-Ver1-VG
426 sudo vgchange -an /dev/Super-LVM-QuietGaragePC-Ver1-VG
429 sudo vgchange -ay /dev/Super-LVM-QuietGaragePC-Ver1-VG
431 sudo fsck -fy /dev/Super-LVM-QuietGaragePC-Ver1-VG/MyQuietGaragePC-Pool-id-1-LV

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*** That is the end of the Restore commands once the last command fsck -fy runs for a few hours. When Completed you will be able to mount your lvm.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I'm Posting the Web Pages and the Source that helped me Resolve my Issue mentioned earlier above...:
Thanks again to the folks at the sites below...:
https://www.linuxtechi.com/fixing-lvm-io-errors/

http://coding.infoconex.com/post/201...ux-Rescue-Disk

Running FSCK on an LVM (Logical Volume Manager) using Linux Rescue Disk
12 October 2012 jscott

I am not a linux expert and so when I have problems from time to time I usually have to go searching for the answer. It usually takes me looking at several articles to get my answer and when I am finished I always try and put together a article that has everything I need to know in once spot. Please feel free to correct or suggest a better alternative if you come across this article and would like to provide feedback.

Yesterday I had a server crash and when I logged into the console it was showing a kernal panic!!

I rebooted and the same thing happened over on every reboot. This machine had some problems in the past with the disk going into read only mode so I assumed the issue was related to something wrong with the disk. So I grabbed a CentOS disk and booted up with it and booted into resuce mode and skipped the step that would mount the disks.

Once in I attempted to run fsck /dev/sda1 but I got an error back indicating it did not recognize the volume as EXT2. Searching around I found the following solution if you are using a LVM.

Perform all of the following commands in the following order. I provided a link for each command if you are interested in knowing more about what each of the commands do.

Scan all disks for partiitions:

lvm pvscan

Scan all disks for volume groups and build /etc/lvmtab and /etc/lvmtab.d/* which are the database for all other lvm commands:

lvm vgscan

Change attributes of a logical volume

lvm lvchange -ay VolGroup00

Scan all disks for logical volumes

lvm lvscan

Then I was able to run fsck as follows

fsck -f /dev/VolGroup00/LogVol00

Which of course reported TONS of errors and fixed them up. I do not claim to be an expert but this worked for me. Hopefully this information will help someone else out in the future.
 
Old 09-13-2018, 07:16 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,468
Blog Entries: 15

Rep: Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452
Thanks for sharing. Please go to Thread Tools and mark your post as Solved. It helps others in future more quickly find posts with solutions.
 
Old 09-16-2018, 09:37 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,212
Blog Entries: 29

Rep: Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422Reputation: 2422
Moderator response

Moved: This thread is more suitable in <LinuxQuestions.org Member Success Stories> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM Error: /dev/sda: read failed after 0 of 4096 at 0: Input/output error sandeep002gupta Linux - Server 4 08-10-2017 07:35 AM
/dev/sdb: read failed after 0 of 4096 at 0: Input/output error deep27ak Linux - Hardware 3 07-24-2015 06:02 AM
LVM /dev/block/104:0: read failed after 0 of 4096 at 0: Input/output error hesisaboury Linux - Server 2 08-19-2013 05:16 AM
/dev/sda: read failed after 0 of 4096 at 0: Input/output error Danesh Linux - Software 3 04-08-2008 06:31 AM
/dev/sda: read failed after 0 of 4096 at 0: Input/output error Danesh Linux - Newbie 1 04-03-2008 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 02:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration