Help getting data off a server with a hard drive problem
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Help getting data off a server with a hard drive problem
I have a server running Ubuntu Server 8.04.2 that is on the fritz; the hard drive is failing (or at best somewhat corrupted) and I cannot boot unless in recovery move, where fsck fails and places the hard drive in read-only mode. Here are some details:
Running fsck manually does not resolve the problem; I have done it a number of times but the drive is still mounted in read-only mode.
I was able to start the SSH server to download files relating to the web services, but I need the MySQL database files as well.
I cannot download anything from the /var/lib/MySQL directory because the files are owned by root.
I cannot enable to root account because the hard drive is in read-only mode, and I cannot start the web services (phpmyadmin) for the same reason.
I also cannot remotely SSH or SCP the files from the server to another because SSH is not part of the recovery mode environment.
I cannot place the hard drive in another computer because it is encrypted (LUKS). I realize that it is possible to decrypt the drive but the tutorial I wrote that explains how to do this is in the MySQL database (it took me quite some time to put it together)!
Can someone, please, provide some promising suggestions? I am running out of options to retrieve the last set of data (very important database files) off my server.
Don't know what 'recovery mode' in Ubuntu is; I'm guessing single user..
Anyway, most Linux install media comes with an option to type
linux rescue
at the very start ie a text prompt before it tries to install. That'll enable you 'run' from the DVD/RAM disk and mount the dying drive.
You should be able to recover from there.
Don't know what 'recovery mode' in Ubuntu is; I'm guessing single user..
Anyway, most Linux install media comes with an option to type
linux rescue
at the very start ie a text prompt before it tries to install. That'll enable you 'run' from the DVD/RAM disk and mount the dying drive.
You should be able to recover from there.
I mention in my previous post that the drive is an encrypted lvm. This really is my last resort, due to time constraints and (to be honest) the learning curve to succeed at this again (I've only done it once before).
Here are the steps I use to unlock an encrypted LUKS partition:
sudo cryptsetup luksOpen <device> <name>
Then enter the passphrase.
Usually the name for a device such as /dev/sdc1 would be _cr_sdc1, however this is arbitrary.
Having an encrypted volume for a server is rare because you need to be present when rebooting to enter the password.
To create the logical devices from an LVM volume:
sudo /sbin/vgmknodes
You will likely need to run vgmknodes if running of a live cd.
---
If the server runs another service such as samba, you will want to read up on which files (such as in /var/) need backing up (if you can't back them all up due to the drive condition).
Thank you for your suggestions. I was able to correct this by forcing read-write on the file system, enabling the root account, and downloading the files via SFTP (through root account). Specific details are noted in this post: Enable root account error: “passwd: Authentication token lock busy”.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.