LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-08-2011, 03:59 AM   #1
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Rep: Reputation: 0
changing faulty hard drive


Hello
our problem is as follow
our main sata hard drive on server has started to fail so we need to change it with new hard drive before any real damage
i dont have such a experience on how we can do this
the OS ( centos) and all installed services (apache + mysql + php ) and all our virtual host and domains ( using whm /cpanel ) are on this faulty hard drive
also i dont have physical access to server and use SSH and whm to manage server
so how should this faulty hard drive be changed and all data be transfered to the new hard drive correctly so the system boot from new hard drive with all content in place ?
i have not done such a thing and im really confused
regards
 
Old 04-08-2011, 04:02 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Quote:
Originally Posted by dime111 View Post
also i dont have physical access to server and use SSH and whm to manage server
Hold on a minute.... So you don't have physical access to the server, yet you are trying to change the hard drive? This makes no sense.... Unless you are saying that someone else is going to change it out, correct?
 
Old 04-08-2011, 04:12 AM   #3
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Hello
Yes data center will plug new hard drive
I just totally do not know what to do next
Thank you
 
Old 04-08-2011, 04:19 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Ahh ok, got ya. Do you have a RAID setup? I really hope so....
 
Old 04-08-2011, 04:23 AM   #5
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
unfortunately no
only two 750 gig hard drives
the main one (which is faulty now ) and second one for whm/cpanel backups
 
Old 04-08-2011, 04:26 AM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Well then I suggest to back up as much data you can from the hard drive and then have it replaced. You should really set up RAID next time so you don't have to worry about constantly backing up and worrying all the time....
 
Old 04-08-2011, 04:30 AM   #7
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Yes i should have raid them this time
But my main question remains how to restore full structure of faulty drive with on new one ?
boot , OS and so on
Thanks
 
Old 04-08-2011, 04:33 AM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Well first of all, how badly damaged is the hard drive? Can you recover anything from it? I can't really help you restore your data if you can't access it....
 
Old 04-08-2011, 04:43 AM   #9
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Yes data is fully accessible in fact the drive is still working
but i can see in logs that it has started to throw I/O errors
 
Old 04-08-2011, 04:47 AM   #10
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Oh ok, well in that case, you could use dd to create an exact clone of the data that is still accessible and go from there. I use dd a lot when it comes to creating clones - http://linux.die.net/man/1/dd
 
Old 04-08-2011, 04:53 AM   #11
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Thanks
So basically i need to format new hard drive and create partitions ?
Sorry but i did not get how DD work to clone whole hard drive which is as follow (having to partitions)
What should the command be ?
Also will it take care of boot info ? and will boot the system from new hard or i need other changes too ?

/dev/sda3 688G 206G 448G 32% /
/dev/sda2 2.0G 86M 1.9G 5% /boot

Last edited by dime111; 04-08-2011 at 04:55 AM.
 
Old 04-08-2011, 04:57 AM   #12
Latios
Member
 
Registered: Dec 2010
Distribution: Arch
Posts: 115

Rep: Reputation: 21
Buy the new drive

Partition and format it similar to the original drive (you can make partitions of different size than the original, just be sure that the amount of data from each partition in the origina drive + expected extra fits in the new one)

Boot the server from a live disk or take the original drive to another computer

Copy with cp -pR the contents of each partition

Fix /etc/fstab and /boot/grub/menu.lst if needed

Install grub on the new drive. In grub 1 (not grub 2) its

Code:
grub-install --root-directory=[where the root partition of the new drive is mounted in the live system]
if you use separate /boot then it must be mounted too before you run this

Put the drive back and test




Notice that not all IO failures are caused by the drive. Test the sata cable, computer and baord for excess dirt, bad capacitors and bad power supply
 
Old 04-08-2011, 05:02 AM   #13
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Thanks
But as i said i dont have physical access to server
This is making things harder for me
 
Old 04-08-2011, 06:44 AM   #14
Latios
Member
 
Registered: Dec 2010
Distribution: Arch
Posts: 115

Rep: Reputation: 21
If you can be root on the system, close all the server tasks and backup the other partitions

The running OS cannot (maybe can but gonna be a trouble) be completely backed up from within itself. You must boot another OS to backup the first one when it is not running. You can ask the techs that have physical access to boot a live usb / cd and open ssh for you (with all needed protections : firewall + custom root password + etc)

Next time install a dual boot with 2 OSes (one main and one small with just some tools and ssh). This way you'll be able to reboot between them to backup each
 
Old 04-10-2011, 11:28 PM   #15
beowulfnode
Member
 
Registered: Jun 2007
Distribution: debian, ubuntu, centos, esxi
Posts: 39

Rep: Reputation: 4
Are the datacenter people just adding a 3rd drive to the system? or are they replacing the original failing drive leaving a maximum of 2 disks?

If you are getting a 3rd drive you could possibly convert to raid 1 with the new drive. There are various instructions for how to do this such as https://wiki.archlinux.org/index.php...system_to_RAID. Then have them replace the failing drive.

If there can only be 2 disks in the system at once and you don't want to have them take the backup drive out temporarily you will likely have to use the backup and restore features.
 
  


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
[SOLVED] Changing hard drive mounts to defaults heberg21 Linux - Newbie 4 01-17-2010 07:55 AM
Changing permissions on a hard drive donk111046 Linux - Hardware 3 05-13-2009 09:36 AM
verify faulty software raid hard drive jwstric2 Linux - Hardware 0 07-06-2004 10:58 PM
Changing Hard drive from one machine to another afubini Linux - Hardware 3 10-30-2003 03:41 AM
changing hard drive location thelight1 Linux - Hardware 3 10-12-2003 06:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:58 PM.

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