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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
09-26-2007, 10:08 AM
|
#1
|
LQ Newbie
Registered: Sep 2007
Posts: 10
Rep:
|
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 !
|
|
|
09-26-2007, 11:25 AM
|
#2
|
Member
Registered: Feb 2006
Distribution: Ubuntu 8.04; Debian Etch
Posts: 167
Rep:
|
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
|
|
|
09-26-2007, 11:47 AM
|
#3
|
LQ Newbie
Registered: Sep 2007
Posts: 10
Original Poster
Rep:
|
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 :-(
|
|
|
09-26-2007, 02:32 PM
|
#4
|
LQ Newbie
Registered: Sep 2007
Posts: 10
Original Poster
Rep:
|
UP
Sorry to up this but this is very important.
|
|
|
09-26-2007, 03:08 PM
|
#5
|
Member
Registered: Jun 2007
Distribution: Knoppix, antiX
Posts: 252
Rep:
|
Did you try to boot from any Linux live cd like Knoppix? You can test then if you can access your partitions.
|
|
|
09-26-2007, 04:57 PM
|
#6
|
LQ Newbie
Registered: Sep 2007
Posts: 10
Original Poster
Rep:
|
Hi master,
This is a dedicated server that i rent, i don't have any physical access to it, only from the web !
|
|
|
09-26-2007, 05:17 PM
|
#7
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Rep:
|
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.
|
|
|
09-26-2007, 08:42 PM
|
#8
|
LQ Newbie
Registered: Sep 2007
Posts: 10
Original Poster
Rep:
|
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 '
|
|
|
09-27-2007, 05:06 AM
|
#9
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Rep:
|
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
|
|
|
09-27-2007, 02:22 PM
|
#10
|
LQ Newbie
Registered: Sep 2007
Posts: 10
Original Poster
Rep:
|
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 !
|
|
|
09-27-2007, 03:52 PM
|
#11
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Rep:
|
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.
|
|
|
09-27-2007, 08:05 PM
|
#12
|
LQ Newbie
Registered: Sep 2007
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
09-28-2007, 06:45 AM
|
#13
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Rep:
|
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.
|
|
|
09-28-2007, 01:59 PM
|
#14
|
Member
Registered: Mar 2005
Location: South Africa
Distribution: Centos, Fedora, Ubuntu desktop, IPCop
Posts: 168
Rep:
|
I agree, usually if you can ssh you can scp, Hope you come right.
|
|
|
09-29-2007, 09:11 AM
|
#15
|
Member
Registered: Feb 2006
Distribution: Ubuntu 8.04; Debian Etch
Posts: 167
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 08:14 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|