Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
First I will start with the obligatory I am new and suck at Linux comment…
Okay now that we have that out of the way.
I have a test db server that has a LVM2 volume that was filled to capacity and corrupted. It would boot up and try to scan the volume but would hang forever. So I booted with a rescue cd and told the server to fast boot skipping the check. That worked and I was able to get into the server.
I ran a e2fsck –c /dev… and it ran for like 3 days (I was told by a Linux friend to let it run as long as it took) but after it was done I could no longer boot the server.
I booted back into the rescue cd and made a cifs mount to my windows box and copied the data off the lvm2 volume to my local hard drive.
I am told that I can now format the volume, add capacity and copy the data back. Then I should be all set. Is that true? Is there any other way to recover the volume as is? Without blowing anything away?
First I will start with the obligatory I am new and suck at Linux comment…
Welcome to LQ.
Quote:
Originally Posted by InvertMe
Is there any other way to recover the volume as is? Without blowing anything away?
Running fsck on a severely mutilated file system may result in a large portion of its contents being written to /lost+found by their inode number. If you run a Linux distribution with a package management that stores hashes of the contents of packages or have a backup you can check contents against then you could go that route but it requires effort (you have to know a bit about the shell and default tools), there's no guarantee (fsck dumping incomplete files), it's inefficient (if you have a backup then why not restore it?) and it's time consuming.
Quote:
Originally Posted by InvertMe
I am told that I can now format the volume, add capacity and copy the data back. Then I should be all set. Is that true?
No because you'll want to implement a backup strategy and resource monitoring before doing that, otherwise: yes.
We sadly don't have a back up, I am new to this company so I had nothing to do with this build/backup strategy. I think their thought process was "it's test, we don't need to back it up". I spend a week trying to get the server back in shape and have given up. I built a new server on our vm cluster and that is backed up. I had to buy more disks, ram, and an extra blade but in the end it's worth it to not have this happen again.
I'm sure I will have TONS of questions as time goes on though. I am sure I will frequent this site a lot.
The key thing is how was it corrupted. A full filesystem shouldnt become corrupted, it might make things hang but usually you are ok for a little bit as 5% of the space is reserved for root by default.
Was it corruption of the block device/raid array, physical volume, volume group, logical volume or the filesystem itself?
If it wasn't the filesystem and you just format it, that corruption could still be there and come back to haunt you later on.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.