LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-24-2010, 05:34 PM   #1
brian.m
LQ Newbie
 
Registered: Nov 2008
Posts: 11

Rep: Reputation: 0
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.
 
Old 02-24-2010, 06:41 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
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.
 
Old 02-24-2010, 07:46 PM   #3
brian.m
LQ Newbie
 
Registered: Nov 2008
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
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).
 
Old 02-24-2010, 08:05 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Where is the encryption layer?

Does is use luks?

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).

Last edited by jschiwal; 02-24-2010 at 08:07 PM.
 
Old 02-24-2010, 08:58 PM   #5
brian.m
LQ Newbie
 
Registered: Nov 2008
Posts: 11

Original Poster
Rep: Reputation: 0
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”.
 
  


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
how to transfer data from one hard drive to another? xpus04 Linux - Hardware 3 10-04-2009 03:43 AM
Reconfigure hard drive that already contains data garyg007 Slackware 5 12-06-2008 08:58 PM
FC5 to FC6 and hard drive upgrade at the same time - problem getting old data neddis Linux - Hardware 8 07-16-2007 10:49 PM
Hard drive data protection rjcrews General 8 02-09-2006 12:08 AM
Getting Data off old hard drive artemis Linux - Hardware 6 11-02-2002 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:43 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