LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-26-2007, 10:08 AM   #1
SethShannon
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Rep: Reputation: 0
Question 1&1 Linux server totally down how to recover data ?


Hello everyone,

I post in "newbies" as i'm totally new to linux and really need your help.

For 2 days my server is totally unreachable via all ways possible.

I could reboot in rescue mode, and all I want is just to retrieve all my data (web, sql bases and so on) before re-installing a fresh new system.

No help is given at all for dedicated servers so I have to find myself a way to solve this.

I made a fdisk -l and here's what i get :

Code:
rescue:/# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         123      987966   fd  Linux raid autodetect
/dev/sda2             124         367     1959930   82  Linux swap / Solaris
/dev/sda4             368       19457   153340425    5  Extended
/dev/sda5             368         976     4891761   fd  Linux raid autodetect
/dev/sda6             977        1585     4891761   fd  Linux raid autodetect
/dev/sda7            1586       19457   143556808+  fd  Linux raid autodetect

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         123      987966   fd  Linux raid autodetect
/dev/sdb2             124         367     1959930   82  Linux swap / Solaris
/dev/sdb4             368       19457   153340425    5  Extended
/dev/sdb5             368         976     4891761   fd  Linux raid autodetect
/dev/sdb6             977        1585     4891761   fd  Linux raid autodetect
/dev/sdb7            1586       19457   143556808+  fd  Linux raid autodetect

Disk /dev/md7: 147.0 GB, 147002097664 bytes
2 heads, 4 sectors/track, 35889184 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md7 doesn't contain a valid partition table

Disk /dev/md6: 5009 MB, 5009047552 bytes
2 heads, 4 sectors/track, 1222912 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md6 doesn't contain a valid partition table

Disk /dev/md5: 5009 MB, 5009047552 bytes
2 heads, 4 sectors/track, 1222912 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md5 doesn't contain a valid partition table

Disk /dev/md1: 1011 MB, 1011548160 bytes
2 heads, 4 sectors/track, 246960 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table
I was told that i had to mount some partitions to be able to retrive my data but impossible to mount/unmount anything :

Code:
rescue:/# mount /dev/sda1 /mnt/sda1
mount: /dev/sda1 already mounted or /mnt/sda1 busy
Anyone could help ?

Thanks a lot !
 
Old 09-26-2007, 11:25 AM   #2
Slick666
Member
 
Registered: Feb 2006
Distribution: Ubuntu 8.04; Debian Etch
Posts: 167

Rep: Reputation: 33
Ok, are you sure that you do not have /dev/sda1 already mounted?

to check try "df -h"

it should display all mounted devices and there location.

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 36G 17G 17G 51% /
varrun 506M 152K 506M 1% /var/run
varlock 506M 8.0K 506M 1% /var/lock
procbususb 506M 192K 506M 1% /proc/bus/usb
udev 506M 192K 506M 1% /dev
devshm 506M 0 506M 0% /dev/shm
lrm 506M 15M 491M 3% /lib/modules/2.6.20-16-generic/volatile
/dev/sdb1 37G 32G 3.1G 91% /vmware
/dev/scd0 50M 50M 0 100% /media/cdrom1

I hope this helps
 
Old 09-26-2007, 11:47 AM   #3
SethShannon
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,

first thanks for your reply !

Here's what i get :

Code:
rescue:/# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/ram0             252M  218M   34M  87% /
tmpfs                 493M  4.0K  493M   1% /dev/shm
So i guess nothing is mounted, that's why i don't understand and i'm quite lost :-(
 
Old 09-26-2007, 02:32 PM   #4
SethShannon
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
UP

Sorry to up this but this is very important.
 
Old 09-26-2007, 03:08 PM   #5
masterclassic
Member
 
Registered: Jun 2007
Distribution: Knoppix, antiX
Posts: 252

Rep: Reputation: 73
Did you try to boot from any Linux live cd like Knoppix? You can test then if you can access your partitions.
 
Old 09-26-2007, 04:57 PM   #6
SethShannon
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Hi master,

This is a dedicated server that i rent, i don't have any physical access to it, only from the web !
 
Old 09-26-2007, 05:17 PM   #7
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649

Rep: Reputation: 148Reputation: 148
I don't have any experience with RAID, but AFAIK you cannot mount sda1 etc. like a normal partition, but have to use /dev/md0 and so on.
I guess it would be worth to search for a good Linux RAID HowTo or threads about that here on linuxquestions.org.
 
Old 09-26-2007, 08:42 PM   #8
SethShannon
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
I see that it's very hard just to try to recover some data :-(

All i want to know is if there's a (quite) simple way to download my date before reinstalling a new OS on the hard drives.

If i'm right, i must mount a partition in rescue mode and then backup the data inside /home (in fact all the files in www, the mysql bases and so on...)

but my server has 2 hard drives in RAID, and i don't have a clue about on which drive are stored my date and how to recover them '
 
Old 09-27-2007, 05:06 AM   #9
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649

Rep: Reputation: 148Reputation: 148
From what I found in the net (http://www.linuxhomenetworking.com/w..._Software_RAID) the command to see the status of your RAID devices should be "cat /proc/mdstat". Your fdisk output leaves the suspicion that you are using RAID 1, disk mirroring.

Another call to see the current setup seems to be "mdadm --detail --scan --verbose". This should give you the mdX device, for example md0 (according to the site linked above). Then you could create a mount point (it's in the link, too), for example "mkdir /mnt/raid" and call "mount /dev/md0 /mnt/raid" and hope the file system type (ext3, reiserfs, xfs etc.) will be autodetected.

If this is not enough info I would file a new thread -- it's basically mounting the RAID device I think and maybe remote copying the files (to your home machine?). With an appropriate title your chances to get the needed help are much better I think. Good luck
 
Old 09-27-2007, 02:22 PM   #10
SethShannon
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks a lot !

I could finally mount /dev/md1 ... md7 and now I can access the files I want to save.

Could you just now tell me how can I retrieve all those files and save them for example on my local PC or on another FTP server and how to retrieve all the databases and their content too ??

Many thanks !
 
Old 09-27-2007, 03:52 PM   #11
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649

Rep: Reputation: 148Reputation: 148
Sorry, no experience with that other than a simple "get <filename>" over ftp. And that probably depends on how you are connected to the box, but again, no real clue

The thing I would try is to tar (*) the files and then (if you have a telnet or ssh connection) to transfer the tar file to your local box. If you have ftp access to the server (unsecure), you could simply connect to it and do "get <filename>", that copies the tar file to your local box. If you have ssh access to the server this might be helpful: http://www.saha.ac.in/cs/www/adware/001_SecureCopy.pdf (see the section "Using FTP over SSH to transfer files"), but I have never tried this. As it seems that not many others are reading this thread now please consider posting a new thread about "copying files to local box with ssh connection" or something like this.

(*) tar: Go to the root folder "/", then do "tar cjvf name-of-archive.tar.bz2 file1-to-save file2-to-save /folder/one/to/save /folder/two/to/save" to put all files and folders in one archive file.
 
Old 09-27-2007, 08:05 PM   #12
SethShannon
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
I only have a ssh access to the server, nothing else. The server isn't reachable via a FTP client, web or anything else but SSH (and no physical access to it of course).

So for now, as I could finally mount the disks and found what specific folders i want to backup, I just need to tar the folders and sql bases, and then find a way to send them to another server i guess (if there's no other solution to download them in local).

I had a look at your pdf file but it shows how to connect using a FTP client, not in SSH.

I also tried to tar a folder : /mnt/md7/www/vhosts/domain_name.com but it doesn't seem to work.
 
Old 09-28-2007, 06:45 AM   #13
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649

Rep: Reputation: 148Reputation: 148
What is the error you get? If I try this here, it works:

Code:
bash-3.1# tar cjvf archive.tar.bz2 /tmp/test/file? "/tmp/test/file with spaces" /tmp/test/testfolder /tmp/test/testfolder2/ 
tar: Entferne führende »/« von Elementnamen
/tmp/test/file1
/tmp/test/file2
/tmp/test/file with spaces
/tmp/test/testfolder/
/tmp/test/testfolder/file3
/tmp/test/testfolder/file4
/tmp/test/testfolder2/
/tmp/test/testfolder2/file5
"less archive.tar.bz2" gives then the following output and shows that all has been backuped (the files are empty, so the size of Null is o.k. here).
Code:
-rw-rw---- root/root       249 2007-09-28 12:33 tmp/test/file1
-rw-rw---- root/root         0 2007-09-28 12:28 tmp/test/file2
-rw-rw---- root/root         0 2007-09-28 12:32 tmp/test/file with spaces
drwxrwx--- root/root         0 2007-09-28 12:30 tmp/test/testfolder/
-rw-rw---- root/root         0 2007-09-28 12:30 tmp/test/testfolder/file3
-rw-rw---- root/root         0 2007-09-28 12:30 tmp/test/testfolder/file4
drwxrwx--- root/root         0 2007-09-28 12:32 tmp/test/testfolder2/
-rw-rw---- root/root         0 2007-09-28 12:30 tmp/test/testfolder2/file5
archive.tar.bz2 lines 1-8/8 (END)
Maybe you noticed that I had to quote the spaces. If I gave the trailing "/" with a folder had no influence at all, both are backed up.


To remote copy a file via ssh I think "scp" is one solution. It's even part of the "PuTTY" package which is available for Windows too. I don't know how simple it is to use. I guess if you have the "scp" command on your server it's worth a try from my short glimpse on the program. PuTTY is available at http://www.chiark.greenend.org.uk/~sgtatham/putty/. Read in the documentation chapter 5 (http://the.earth.li/~sgtatham/putty/...ter5.html#pscp), it looks straight forward.
 
Old 09-28-2007, 01:59 PM   #14
mickza
Member
 
Registered: Mar 2005
Location: South Africa
Distribution: Centos, Fedora, Ubuntu desktop, IPCop
Posts: 168

Rep: Reputation: 33
I agree, usually if you can ssh you can scp, Hope you come right.
 
Old 09-29-2007, 09:11 AM   #15
Slick666
Member
 
Registered: Feb 2006
Distribution: Ubuntu 8.04; Debian Etch
Posts: 167

Rep: Reputation: 33
if you have ssh you can transfer file via scp or sshfs. I would use the simple method scp <source> <destination>.

From your local machine it would be

scp user@server:<remote directory> <local directory>

see http://linux.die.net/man/1/scp for more info
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Recover data on formatted hd; installed linux to 'wrong' disk rmark999 Linux - Newbie 2 07-26-2007 07:19 AM
Recover data from Linux shipon_97 Linux - Newbie 4 04-17-2007 11:36 PM
formatted my c:, linux boot data lost, how could i recover sas_tvr Linux - General 1 01-18-2005 07:56 AM
Server crash, trying to recover mysql data from old HD? Vatoloco Linux - Software 2 06-20-2004 12:15 PM
Using Linux to recover data on a damaged Windows partition? Korff Linux - General 5 12-29-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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