Need to make working copy of failing HDD
I run a sever 24/7/365 with Debian 5.0.4 (lenny) GNOME 2.22.3. It seems that the HDD is beginning to fail as it starting to clunk & you can hear it spinning up & down.
I had lots of help in setting up the server, and i am not that good with linux...but i am learning all the time ;) I have a spare HDD lying around, and i am wondering if its possible to use it to make a "exact working copy" of the HDD whats failing ? The spare HDD actually has XP on it, but i cannot see this preventing it from being used ?? As my knowledge is still very little with Linux, and its important for me to replace the HDD, can anyone point me in the right direction to copying failing HDD ?? Also is it possible to then fit the new HDD into my server and it will work straight away ? This is to prevent any added downtime on my 24/7/365 server.. Kindest regards |
PartImage or the dd command from a liveCD/liveUSB should do the trick.
|
Hi mate....many thanks for taking time out to advise me...is there a tutorial anywhere for doing any of these ?? Like i said i am very new to linux ( very slowly migrating from xp ) and it is a bit overwhelming....I am frightened that i screw things up completely and lose all my data on the server..Kindest regards
|
Quote:
- If the contents of the target don't matter and you can attach it directly using (E)IDE, SATA, USB, Firewire then you can make a direct copy: if the victim resides at /dev/hda and the target is attached at /dev/sda then a direct copy between disks that are equal in size can be done with (as root) with 'dd if=/dev/hda of=/dev/sda'. II. If the victim is still good (or deteriorating very fast) and you would have no problem spending time replicating the setup then you could save time and only save the important parts while they're mounted. For this scenario you'll need another disk for rebuilding the server though. Again with the victim residing at /dev/hda and the target attached at /dev/sda: - delete the partiton table on /dev/sda: 'dd if=/dev/zero of=/dev/sda count=1 bs=1M', then - create a new partition table and one ext2 partition spanning the whole disk: 'fdisk /dev/sda' and press "o", press "n" choose primary, number 1, type "t", change type to "83" (Linux), press "w" then press "q". Now create the filesystem on the disk: - 'mkfs.ext2 /dev/sda1' and mount it: - 'mkdir /RESCUE; mount /dev/sda1 /RESCUE' after which you can list the partitions contents with 'ls -al' to verify there's only one directory named "lost+found" and 'df -mh' to check the size matches. Now run - 'fdisk -l > /RESCUE/fdisk.log' output for recreating the partition table later on, backup directories /etc, /var, /home, /root, /boot (if separate), any data that needs saving while still accessible like mounted, encrypted filesystems, the /var/lib/dpkg package management information and stored information the machine serves up for others (webserver docroot, databases) with - 'tar -cf /RESCUE/data.tar /etc /var /home /root /boot /var/lib/dpkg' (add any directoies you need). III. If the victim is deteriorating faster and corruption should be anticipated then you should not waste time and use ddrescue or dd_recue instead (provided the target disk is similar or greater than the victim drive) and it would be best not to power down the server to attach the target but use an external encasing, mount via USB then run 'fdisk -l' again to see where the target is attached (probably /dev/sda unless device name was taken). Wrt dd_rescue create a single partition on the target as outlined under II then see post #16 and post #30 for a commandline example (substitute device names and mount points). The whole thread may actually be interesting to read as PTrenholme and I offer information about ddrescue vs dd_rescue. * If unsure ask questions before you do anything but only after you've ensured the state of the victim drive still allows you time. |
Hello there.....A lot of that info you provided me has actually gone straight over my head..lol.....However i do have a external USB attached HDD i can use to "copy" the internal HDD drive over to, can i then copy from the external HDD to a replacement internal HDD....It is so important that i have the least amount of downtime possible...would this way be ok ? Also do i need to do this with a monitor and keyboard etc attached to the server, or can i do all this with VNC viewer through my XP based desktop PC ?? Kindest regards to you all
|
Quote:
Quote:
Quote:
Quote:
* BTW: posting the 'fdisk' output and commands (in full!) you think you should run allows us to see if it's going to work. |
Hello again everyone.....I can answer your questions......I use my server to run CCcam, this shares my Sky viewing with several satellite receivers ( this eliminates having to get sky multiroom etc ) I also share my card with other satellite enthusiasts across Europe, and they share their card with me...So as you can imagine, as soon as the server stops...The picture also stops !! lol.
My server is running at the moment, but i am playing it safe and making sure that i can copy the failing HDD before it does fail completely...so i am not in any rush to make a copy.. I have just managed to reformat my USB external HDD to type "83" with using putty, and the drive is being shown as /dev/sda Kindest regards |
Quote:
Quote:
|
Use photorec
|
My 2cents:
If it was my server, I'd want to back it up whilst it was not running. Otherwise you might end up with some "file inconsistencies". Eg a file is modified by the OS or a running application after it has been copied, and this might matter when it is restored. So I'd boot from a live CD, and make the copy from there, being very very careful about which disks I was copying from and to, especially if using the dd ( "doubly dangerous" ?) command. You will not be able to do this if your server doesn't have a keyboard & monitor. Another approach might be to remove your server's HDD and put it in a USB-connected enclosure. Then you will be able to copy it by plugging it (and the disk that is to replace it) into a linux PC with a working screen and keyboard. Quote:
Do you have a local Linux Users Group? This is the sort of thing they are very good at helping with. Are you in the UK (Stoke) ? |
Quote:
|
Quote:
I also have got a spare keyboard and monitor available too do such a job. With reference to fitting the servers HDD into an enclosure, thats not possible as all my external HDD's are using SATA within them, and my servers HDD is IDE...but its a good idea, and if i could do so i would use it. If i managed to format the external HDD via putty, and the OSD showed i was doing it ok by entering /sda for the locaton of the external HDD, surely it must be ok ?? Also i am not aware of any local linux groups at all....And i do live in Stoke.......can anyone possibly help me complete my task ??? Kindest regards |
Quote:
A competent person will not need a USB enclosure, just a live CD, KBD, monitor and new HDD Quote:
Offer beer ;) |
See this post: http://www.linuxquestions.org/questi...ommand-362506/
|
Depending on the actual size of the server's hdd,
which would indicate just how long the cipy process would actually take, what I would do is shut down the sever & boot the PC from a rescue-linux cd, & run Gparted. Using that to perform a image copy disk - disk, from the old/failing hdd to the new hdd, erasing anything on the new disk, in the process. This would give a exact copy of the old disk & would also be bootable in the same way. as the op is not linux literate, this way is a GUI & more achievable. |
All times are GMT -5. The time now is 02:56 PM. |