Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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 ?.
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.
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 ....
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).
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).
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.