Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
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.
|
|
03-13-2011, 04:26 PM
|
#1
|
Member
Registered: Apr 2005
Posts: 252
Rep:
|
What's Best Way to Backup a web server with one hard drive Running live
I currently have a centos 4.4 I believe running with a 250GB hard drive. I want to make an image of that hard drive. I have tried removing the drive and connecting it to my windows pc using an adapter that would allow my windows machine run the hard drive as it was a regular external hard drive. Of course windows doesn't reconize that drive since it is linux partitioned. I am thinking that I need to have the hard drive in the box I am wanting to copy and put in a blank drive in the box that I want to copy to. And boot from a live CD and use cat or dd to copy it. I have seen the commands before bust I am thinking this is the only way. Basically I am wanting to have a duplicate of the drive and build a whole new server that is already all setup. I will just change the host name and assign it another Public facing UP. Is this correct? Oh, and the new server will have different hardware. Might even be AMD or intel different from source or destination.
|
|
|
03-13-2011, 04:48 PM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
There are a lot of ways to do this. The simplest way may be to use Clonezilla Live.
http://clonezilla.org/
My experience simply moving a configured Linux system from one piece of hardware to another is not encouraging. If the second computer were exactly the same as the first then you would be fine. If the second computer is significantly different then you may be better off installing Linux the usual way on that machine.
|
|
|
03-13-2011, 04:51 PM
|
#3
|
Member
Registered: Aug 2009
Location: Brazil
Distribution: Ubuntu Lucid
Posts: 45
Rep:
|
Tip of the day: Making Shells Scripts is a good way to automatize the process
|
|
|
03-13-2011, 05:06 PM
|
#4
|
Member
Registered: Apr 2005
Posts: 252
Original Poster
Rep:
|
Quote:
Originally Posted by stress_junkie
There are a lot of ways to do this. The simplest way may be to use Clonezilla Live.
http://clonezilla.org/
My experience simply moving a configured Linux system from one piece of hardware to another is not encouraging. If the second computer were exactly the same as the first then you would be fine. If the second computer is significantly different then you may be better off installing Linux the usual way on that machine.
|
. So starting over is best. That web server has one hard drive like I said. I have another hard drive that is exactly the same drive. I would like to dup it as a backup. Or is there some way I can add the drive and make it a mirror a raid or is that out of the question since it is already up and going. The motherboard doesn't have anything but IDE on board controllers without hardware raid. I wanted to make a software raid before and could really understand it. It looks like I would need one drive for booting and 2 drives for the mirror and storage. So I am pretty much going to probably need to build a new machine with hardware raid mirror or raid 5 and start over. Then when I run out of space build another from scratch? So I guess I need to just dup the drive currently often and just keep that hard drive around in case it crashes. I guess the sucky part is that I will have to pull the server out of the racks often to do this. But I haven't looked at that site yet.
|
|
|
03-13-2011, 05:12 PM
|
#5
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
IMO you would be better off to duplicate the drive to use the second one as a backup. Then you could potentially use rsync to keep the second drive up to date.
I hate RAID. It solves some problems but it has its own problems. RAID is probably required for some situations. In those cases hardware RAID is best. Otherwise keeping a backup disk that you manually update is the easiest solution. If you needed to boot the backup drive because the primary drive failed you could have to persuade GRUB to use the second drive. That is not difficult. Cross that bridge when (if) you come to it.
|
|
|
03-13-2011, 05:18 PM
|
#6
|
Member
Registered: Apr 2005
Posts: 252
Original Poster
Rep:
|
Quote:
Originally Posted by stress_junkie
IMO you would be better off to duplicate the drive to use the second one as a backup. Then you could potentially use rsync to keep the second drive up to date.
I hate RAID. It solves some problems but it has its own problems. RAID is probably required for some situations. In those cases hardware RAID is best. Otherwise keeping a backup disk that you manually update is the easiest solution. If you needed to boot the backup drive because the primary drive failed you could have to persuade GRUB to use the second drive. That is not difficult. Cross that bridge when (if) you come to it.
|
I would like to do it the usb way. But I have had trouble in the past getting the machines to reconize a USB device attached. Is there a good sync software for that?
|
|
|
03-13-2011, 05:24 PM
|
#7
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
Recognizing a USB device is a different issue. If you are referring to Windows recognizing the device, as you mentioned in your first post, then you may have better luck under Linux. If the machine is old then it may only have USB v1 while your external device is USB v2. That won't work well if at all.
Clonezilla should recognize a USB attached disk drive if the motherboard recognizes it.
|
|
|
03-13-2011, 05:41 PM
|
#8
|
Member
Registered: Apr 2005
Posts: 252
Original Poster
Rep:
|
Quote:
Originally Posted by stress_junkie
Recognizing a USB device is a different issue. If you are referring to Windows recognizing the device, as you mentioned in your first post, then you may have better luck under Linux. If the machine is old then it may only have USB v1 while your external device is USB v2. That won't work well if at all.
Clonezilla should recognize a USB attached disk drive if the motherboard recognizes it.
|
It was the linux machines I was speaking of. Like the servers in the rack. I would like to be able to plug in and do some sort of backup with maybe clonezilla. I will check the USB versions. Is I was told before they would be automatically picked up. I figured you would have to mount them or something. Also backing it up while it is running as the primary drive, is that going to be a problem.
|
|
|
03-13-2011, 05:45 PM
|
#9
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
Backing up a running system is a little bit different. If you start with a Clonezilla backup and then use rsync to keep the backup up to date then you should be okay. Test it though. Don't wait until you need the backup to see if it will work.
|
|
|
03-13-2011, 05:47 PM
|
#10
|
Member
Registered: Apr 2005
Posts: 252
Original Poster
Rep:
|
Quote:
Originally Posted by stress_junkie
Backing up a running system is a little bit different. If you start with a Clonezilla backup and then use rsync to keep the backup up to date then you should be okay. Test it though. Don't wait until you need the backup to see if it will work.
|
Far as testing it like you said I think would be an excellent idea. To do this, should I just remove the working drive as if it had crashed and then put in another drive as if I replaced it and then what? do I have to install a distro to sync it back? again that questions might get answered when I check up on clonezilla.
|
|
|
03-13-2011, 05:57 PM
|
#11
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
You would restore from the backup drive to the replacement drive using Clonezilla.
Keep in mind that this whole scenario came about due to your original post. This is not how I back up my machines. When I get a machine set up I back up the MBR to the root directory then I make tar backup files to an external disk drive. Restoring to a new hard drive is very easy. However keeping the backups up to date is more work than the method that we have been discussing. My method allows me to back up several machines to one external disk drive.
Last edited by stress_junkie; 03-13-2011 at 06:10 PM.
|
|
|
03-13-2011, 06:51 PM
|
#12
|
Member
Registered: Apr 2005
Posts: 252
Original Poster
Rep:
|
Quote:
Originally Posted by stress_junkie
You would restore from the backup drive to the replacement drive using Clonezilla.
Keep in mind that this whole scenario came about due to your original post. This is not how I back up my machines. When I get a machine set up I back up the MBR to the root directory then I make tar backup files to an external disk drive. Restoring to a new hard drive is very easy. However keeping the backups up to date is more work than the method that we have been discussing. My method allows me to back up several machines to one external disk drive.
|
Definetly an easy backup would be great . Now I made a tar the other day but it's on the same drive. moving it was the hard part. I guess I need to go check out clonezilla. How are you backing up MBR? I am not asking for you to spoon feed me but it sounds like you got a system down and it must be working out for you well. I need a system for that. If you don't mind, could we talk about it maybe in another post or on a IM or something or you could pm/email me a process? I would be so thankful. I want to have a backup for 2 DNS, 2 Web Server(Low data amount) and 2 other linux servers doing misc stuff.
|
|
|
03-13-2011, 08:28 PM
|
#13
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
Back up the MBR as follows:
Code:
dd if=/dev/sda of=/sda-mbr.dd bs=512 count=1 conv=notrunc,noerror
Restore the boot code without the partition table as follows:
Code:
dd if=/sda-mbr.dd of=/dev/sda bs=440 count=1 conv=notrunc,noerror
Usually the MBR backup file would not exist on the same disk as the target but it can.
The methods that I have been using are based on practices in large data centers. I use these methods to practice my professional skills so the things that I do with my own machines are not necessarily the best choice for home or small business settings. For example a small business would be better off using a commercial application like Acronis for Linux. A home setting may be better off doing what we discussed above using Clonezilla and rsync.
Last edited by stress_junkie; 03-14-2011 at 07:10 AM.
|
|
|
All times are GMT -5. The time now is 04:01 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
|
|