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 have 3x 10tb disks in my server, and one of the three was dedicated solely to my plex media (for now). i had a lvm thinpool and stupidly created a drive in the thinpool for 10tb (which was too big, obviously). now i've filled the drive and am getting io errors, and can't reactivate it. i also can't repair it because there's no space left on the disk.
how can i fix this and get the data off the disk if i need to format and start over? i have enough room elsewhere to copy files to if i can get them mounted, but i've had no luck figuring out how to get the drive activated and mounted to get the data off of it and move it elsewhere...
i've added a 256GB usb stick and an additional 8tb drive that are completely empty in an attempt to extend this thing and get it mounted so that i can get the data off of it, wipe it and start over fresh, but i'm having absolutely no luck and i'm just getting extremely frustrated at this point. i'm going on about 3 weeks of trying to fix this thing and i have gotten absolutely nowhere.
last point before someone hopefully can help me: i do have what i believe is a valid metadata dump...but i'm getting nowhere trying to get it to work. i've gotten some combination of device or resource busy, or invalid argument errors...at this point i honestly don't even know which goes with which. i've tried everything i can think of.
you may need to use --activationmode partial|degraded
but they are usually for when a pv is missing
it would probably help if you listed the commands you have tried
Code:
history | grep -E "(vg|lv|pv)[a-Z]"
vgchange and lvchange are the two commands i've been trying to activate it. i always end up with one error or another.
here's another forum post i wrote up for this on another forum:
here's where i'm at. initially, after trying to run a repair, i got an error similar to the following:
device-mapper: resume ioctl on (252:3) failed: Invalid argument
Unable to resume vg02-pool0-tpool (252:3)
device-mapper: resume ioctl on (252:3) failed: Invalid argument
Unable to resume vg02-pool0-tpool (252:3)
along with this there were the following lines in dmesg:
[191450.356266] device-mapper: thin: Data device (dm-8) discard unsupported: Disabling discard passdown.
[191450.356270] device-mapper: thin: 253:9: metadata device (4145152 blocks) too small: expected 4161600
[191450.356275] device-mapper: table: 253:9: thin-pool: preresume failed, error = -22
that led me to the following link:
the most recent thing i've tried to do is attempt to restore my metadata using the procedures outlined there.
thin_dump /dev/mapper/vg02-pool0_tmeta > lvm_meta_dum
lvcreate -n pool0meta2 -L 12G vg02
thin_restore -i lvm_meta_dump -o /dev/mapper/vg02-pool0meta2
lvconvert --thinpool vg02/pool0 --poolmetadata vg02/pool0meta2
this has left me the following error when trying to extend or activate:
root@proxmox:~# lvextend /dev/pve2/data2 /dev/sde1
device-mapper: create ioctl on pve2-data2_tmetaLVM-Zg3oPyGdhFhGZJ7ixqUTMLj61ITjaVbGHweBLt5PoD9nl0Z92YcC63HLr9SvHLNf-tmeta failed: Device or resource busy
Failed to activate pve2/data2.
or
root@proxmox:~# lvchange -ay pve2
device-mapper: create ioctl on pve2-data2_tmetaLVM-Zg3oPyGdhFhGZJ7ixqUTMLj61ITjaVbGHweBLt5PoD9nl0Z92YcC63HLr9SvHLNf-tmeta failed: Device or resource busy
device-mapper: create ioctl on pve2-data2_tmetaLVM-Zg3oPyGdhFhGZJ7ixqUTMLj61ITjaVbGHweBLt5PoD9nl0Z92YcC63HLr9SvHLNf-tmeta failed: Device or resource busy
If worst comes to worst it should be possible to use the metadata info to create a dmsetup mapping that constructs a device that holds the chunks of your LV, thus allowing you to extract your data. Because of the way chunks get allocated in a thinpool it's going to be somewhat a mess, and really messy if stripes, snapshots, or mirrors are involved, but should still be possible.
I'd need to see that metadata in order to help with that. It's probably too large to post inline here, and I suspect you need a higher post count in order to create an attachment, so you may need to put it in a pastebin somewhere and post a link.
sdd is the 256gb usb stick, and sde is the new 8tb external. i'm actually going to return the 8tb and pick up a 10tb instead, as it's on sale now at best buy...but same difference.
If worst comes to worst it should be possible to use the metadata info to create a dmsetup mapping that constructs a device that holds the chunks of your LV, thus allowing you to extract your data. Because of the way chunks get allocated in a thinpool it's going to be somewhat a mess, and really messy if stripes, snapshots, or mirrors are involved, but should still be possible.
I'd need to see that metadata in order to help with that. It's probably too large to post inline here, and I suspect you need a higher post count in order to create an attachment, so you may need to put it in a pastebin somewhere and post a link.
it was too big to upload here or pastebin, so i put it on my dropbox and created a share link. here you go:
OK, I've downloaded it. One more thing I'll need is the LVM metadata file for the VG in /etc/lvm/backup so that I have the correct parameters and names for the LVs. I may be too busy to do much on this for a day or two.
OK, I've downloaded it. One more thing I'll need is the LVM metadata file for the VG in /etc/lvm/backup so that I have the correct parameters and names for the LVs. I may be too busy to do much on this for a day or two.
that's totally fine, i really appreciate you taking the time to look at it. i've been trying for over a month and gotten absolutely nowhere, so for you to do this for me i'm extremely grateful.
With luck, and perhaps the application of a few unicorn tears, /dev/mapper/dummy should contain your old filesystem. Note the "--readonly" option recommended for safety. If it gets to the point that you think running fsck is necessary and would not cause further damage, then remove the "dummy" device and re-create it without that option. On second thought, that would be a terrible idea since writes to any addresses mapped to the "zero" target would be silently discarded. Think of the result should fsck try to fix anything and some of its writes were ignored. Leave it read-only. There are ways to set up a writable snapshot should it become necessary to do repairs.
(And yes, I know that script is not a robust way to parse XML. It works just fine for the file in question.)
Last edited by rknichols; 09-05-2019 at 09:47 PM.
Reason: On second thought, ...
Well that appears pretty straight-forward ....
Nice - you continue to amaze me with the capabilities of device manager; which I thought was fading into history ....
Nice - you continue to amaze me with the capabilities of device manager; which I thought was fading into history ....
"Fading into history"??? It's the direct interface to the device mapper that handles all the mappings for partitions, LVM, RAID, virtual disks..., basically anything that needs to map a block offset in a logical device into an offset in the next outer layer of the onion.
Yes the script is pretty straightforward. It took longer to set up a test environment and figure out the necessary incantation to get thin_dump to produce a map than it did to write and debug the script.
My bad - I was thinking of "direct" interactions like dmraid. In some senses dmsetup seems a hang-over from times past.
These days almost everyone uses the higher level interfaces - hence threads like this pop up.
With luck, and perhaps the application of a few unicorn tears, /dev/mapper/dummy should contain your old filesystem. Note the "--readonly" option recommended for safety. If it gets to the point that you think running fsck is necessary and would not cause further damage, then remove the "dummy" device and re-create it without that option. On second thought, that would be a terrible idea since writes to any addresses mapped to the "zero" target would be silently discarded. Think of the result should fsck try to fix anything and some of its writes were ignored. Leave it read-only. There are ways to set up a writable snapshot should it become necessary to do repairs.
(And yes, I know that script is not a robust way to parse XML. It works just fine for the file in question.)
i ended up with syntax errors...
Code:
awk: remapper.awk: line 13: syntax error at or near ,
awk: remapper.awk: line 17: syntax error at or near ,
awk: remapper.awk: line 21: syntax error at or near ,
it seemed like it was hung after that, so i killed it with ctrl-c. on running again, i got the syntax errors one more time but now also get:
Code:
device-mapper: create ioctl on dummy failed: Device or resource busy
Command failed
Last edited by crackers8199; 09-06-2019 at 01:08 PM.
I think that when you copied that script to a file you did it in a manner that the something in lines 13, 17, and 21 got interpreted by the shell and were not copied literally. Look at the awk script in an editor, and make sure it is exactly what I posted. The lines in question are the three "match(...)" calls. See the subsequent posts.
I think you'll find that "dummy" now exists as an empty device. Use "dmsetup remove dummy" to get rid of it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.