LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-16-2016, 08:03 AM   #1
jross54000
LQ Newbie
 
Registered: Feb 2016
Posts: 9

Rep: Reputation: Disabled
Question LVM2 input/output Error after power outage


I recently converted a 3TB drive in my home computer to an LVM2 volume. Everything went fine until I began copying files to the new volume; in the middle of copying, the power went out for a couple of seconds.
Now when I try to add or remove files from that volume I get an input/output error:

Desktop # cp testfile.txt /media/jross/4BBB706D0FED271E/Movies/testfile.txt
cp: cannot create regular file ‘/media/jross/4BBB706D0FED271E/Movies/testfile.txt’: Input/output error

I've tried inactivating/reactivating the LMV volume and group with lvchange and vgchange with no success (there are no errors, but the result is the same afterward).
Any advice appreciated.
 
Old 02-16-2016, 06:53 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
So this is the initial load of data to that volume ?. Hence you can afford to lose everything on it, and just copy it again ?.
If "yes": - unmount the lv and re-run the mkfs, remount and re-copy. Done.

If "no": - much more detail needed.
Have you run a fsck, what does dmesg show (that's relevant) ?.
How good/recent are your backups ?.
 
Old 02-17-2016, 08:52 AM   #3
jross54000
LQ Newbie
 
Registered: Feb 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you for the response.
Ultimately, I did end up scrapping the initial implementation and creating a new LVM volume. This time it worked fine; all of my files from the original drive have been copied successfully.
This is my second [kind of negative] experience with LVM. The first occurrence was a few weeks ago when my NAS drive failed (it was actually the ethernet interface and power supply card that that failed - the drive itself was fine). I was shocked to find out that I couldn't simply access the files directly, but instead had to reconstruct the LVM file system. I recovered all the data so I guess its not all bad.
Given these two instances, I am a little nervous about the reliability aspect of LVM. I am now at the jumping-off point as my next step is to reformat the source drive (the data that failed to copy as a result of the power failure) and add it to my LVM cluster. The LVM drives will then be the sole source of these files.
My ultimate goal is to apply the LVM structure across four drives totalling 18 TB of drive space. While these files are not important (mostly media files), there is a significant time investment in the transition to the LVM file system.
Thoughts?
Thanks again for the previous reply and advice.
 
Old 02-17-2016, 08:21 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
LVM is pretty robust, but you need to develop a better understanding of where it sits methinks.
LVM is a (nother) device block layer between you and the bits that are your data. An emulation layer sitting on top of the (real ?) device drivers. So to get at your data, you need both the lower level (block) device driver, and LVM block device driver. Just the way it is, so you can enjoy the convenience it offers.
It is not a filesystem, nor (normally) clustered - the power failure issue was a filesystem breakage. That happens regardless of LVM. But LVM does enable you to manage multiple devices (RAIDed or not) easily - if you don't get too funky with it. Redhat have probably the best doco at docs.redhat.com - just be careful that the features they reference are available on your distro; failure policy for example.

Persevere with LVM, it'll make life easier. Really ....
 
Old 02-18-2016, 09:04 AM   #5
jross54000
LQ Newbie
 
Registered: Feb 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
I agree I need to develop a better overall understanding of LVM. I'll definitely checkout the docs.redhat.com site.

Yesterday, I reformatted the 5T drive, added an LVM partition to it, and added it to my existing LVM volume group (3TB) using pvcreate and vgextend. That went pretty well, except I can't seem to get the OS to recognize the full volume of ~8TB (at least consistently).

- pvdisplay shows both physical volumes, 2.73TB & 4.55TB (7.28T total)
- vgdisplay likewise shows 7.28TB

- df -h shows only 4.9TB: /dev/mapper/Media-Plex 4.9T 1.2T 3.8T
- parted -l shows 8TB: Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/Media-Plex: 8002GB

- pydf shows 5TB: /dev/Media/Plex 5000G 1144G 3856G 22.9

I tried unmounting the volume and extending it to the full size using ntfsresize. It appeared to work but most of the OS disk utilities still show the smaller size (my thought is that it is simply reading the size of the last physical drive I added (5TB).

Any idea what I'm doing wrong here?
 
Old 02-19-2016, 10:40 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
df shows mounted filesystems, not partitions or lvs.
You need to extend the lv as well as vg and pv (note, pv first, then vg, then lv), then resize the filesystem. I don't screw much with NTFS, but by default most systems will fill the partition/lv. If you don't resize the lv, nothing happens.
 
Old 02-22-2016, 10:27 AM   #7
jross54000
LQ Newbie
 
Registered: Feb 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
I should have mentioned that I attempted lvextend also with no luck. After some additional attempts and a little research, I concluded that using NTFS with LVM creates unnecessary complexity with no real advantages.

So, I removed the contents of the additional drive, changed the filesystem to Ext4, and then migrated the contents and other drives to the the Ext4 logical volume. This worked well until I attempted add the final 5TB drive to the existing logical volume of 13TB. In my limited research, I was under the impression that Ext4 could support volumes up to 1EiB. Unfortunately, in 32 bit mode (which is the default when creating an Ext4 volume), it can only support up to 16TB, a couple of TB's fewer than my actual physical drive space.

There seems to be a lot of confusion on how exactly to convert to a 64-bit version of Ext4, so in the end, I simply created a second logical volume. This works fine for my needs and still allows the flexibility to add/remove drives as necessary and to adjust the logical volume space as necessary (I will never need a full 16TB for either volume).

I think this meandering thread, which began as an attempt to recover from a power outage, is mostly resolved. I'd be glad to hear any final thoughts you may have, but I don't want to keep drawing on your time as I learn LVM. You've been very helpful and I really appreciate it - thank you.
 
Old 02-22-2016, 07:42 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Look at "man ext4" - looks like you need to create it as 64bit to allow the later resize to work.
Untested by me.
 
  


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
[SOLVED] stty: standard input: Input/output error [bash] DoME69 Programming 7 05-22-2015 12:14 AM
Error fsyncing/closing/dev/sda: Input/output error Petalocsta Linux - Laptop and Netbook 2 11-07-2011 05:40 PM
aplay: pcm_write:1029: write error: Input/output error mimithebrain Linux - Software 2 12-04-2007 11:51 AM
RPM iinstallation [error: failed to stat /mnt/windows: Input/output error] Ameii83 Linux - Software 1 04-09-2007 07:05 AM
cp - error reading /mnt/cdrom/mpegav/avseq01.dat input/output error manishsingh4u Linux - General 2 10-17-2005 05:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:30 AM.

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