Overclock.net banner

1 - 15 of 15 Posts

·
Registered
Joined
·
1,762 Posts
Discussion Starter · #1 ·
I recently finished setting up my first Linux file server, and I'd like to make a backup of all the tweaked settings by making a copy of the disk it's installed on. If the first disk ever breaks or an update messes something up, I'd like to be able to swap disks to get it working again immediately.

Can I just copy/paste everything on the first disk to the 2nd disk?

If there is more to it, is there free software that will do it?
 

·
Registered
Joined
·
1,125 Posts
You could have a look at software RAID.

There are a few disk image creators and I think one of them is Partimage or clonezilla just check it.
 

·
Premium Member
Joined
·
8,041 Posts
tbh I wouldn't bother with Clonezilla etc if you just want to back up one disk. Just run this as root from the command line:

Code:

Code:
dd if=/dev/sda of=/mount-point-for-disk-2/debian-backup.iso
You will need another storage device mounted (be it local, removable or internal storage) - but that would be the case however / whatever software you used.

(you can also cat /dev/sda > /mount-point-for-disk-2/debian-backup.iso if you prefer.
 

·
Premium Member
Joined
·
29,533 Posts
Quote:
Originally Posted by Plan9 View Post

tbh I wouldn't bother with Clonezilla etc if you just want to back up one disk. Just run this as root from the command line:

Code:

Code:
dd if=/dev/sda of=/mount-point-for-disk-2/debian-backup.iso
You will need another storage device mounted (be it local, removable or internal storage) - but that would be the case however / whatever software you used.
(you can also cat /dev/sda > /mount-point-for-disk-2/debian-backup.iso if you prefer.
Small note, that would be an .img file, not an .iso
tongue.gif


And yes, you can just copy+paste all the contents. The only thing that won't be preserved is the boot loader, which is easily restored.
 

·
Registered
Joined
·
1,762 Posts
Discussion Starter · #7 ·
Quote:
Originally Posted by gonX View Post

And yes, you can just copy+paste all the contents. The only thing that won't be preserved is the boot loader, which is easily restored.
How would I restore a boot loader?
 

·
Premium Member
Joined
·
8,041 Posts
Quote:
Originally Posted by willis888 View Post

How would I restore a boot loader?
That would. You're taking a snapshot of the HDD and saving it as a file (like an ISO CD image, except this would be a HDD image)
 

·
Registered
Joined
·
1,762 Posts
Discussion Starter · #9 ·
Quote:
Originally Posted by Plan9 View Post

Quote:
Originally Posted by willis888 View Post

How would I restore a boot loader?
That would. You're taking a snapshot of the HDD and saving it as a file (like an ISO CD image, except this would be a HDD image)
"That" as in this?:
Quote:
dd if=/dev/sda of=/mount-point-for-disk-2/debian-backup.iso
I'm a little confused because to me it looks like that command will create an image file. Then I would need to use some program to transfer that image onto a disk in a way that makes the disk bootable.
 

·
Premium Member
Joined
·
8,041 Posts
Quote:
Originally Posted by willis888 View Post

"That" as in this?:
I'm a little confused because to me it looks like that command will create an image file. Then I would need to use some program to transfer that image onto a disk in a way that makes the disk bootable.
As long as your boot loader is installed on /dev/sda (be it the MBA or inside a partition table) then the boot loader will be saved along with the file system contents.

Restoring it will be doing the same command in reverse: dd if=/image of=/dev/sda
 

·
Registered
Joined
·
1,762 Posts
Discussion Starter · #11 ·
Thanks for your patience and assistance. I don't have many bash commands memorized yet, and the manual for 'dd' was very helpful.

Would this:

Code:

Code:
cat /dev/sda > /mount-point-for-disk-2/debian-backup.iso
ignore blank space on the drive and create a smaller .iso compared to 'dd'?
 

·
Premium Member
Joined
·
8,041 Posts
Quote:
Originally Posted by willis888 View Post

Thanks for your patience and assistance. I don't have many bash commands memorized yet, and the manual for 'dd' was very helpful.
Would this:

Code:

Code:
cat /dev/sda > /mount-point-for-disk-2/debian-backup.iso
ignore blank space on the drive and create a smaller .iso compared to 'dd'?
That would do exactly the same as dd - in fact I personally use cat rather than dd myself.
 

·
Premium Member
Joined
·
6,819 Posts
Yeah you should backup, restore, and grow. This ONLY works if one disc is equal or larger than the other, and it has to be the disc your copying too. But backup, restore, than grow the filesystem to fill the new drive. Restart, welcome to your same old system!
 

·
Registered
Joined
·
1,762 Posts
Discussion Starter · #14 ·
Thanks mushroomboy. I wonder if backup and restore mean what I think they mean, and I can't even guess at what 'grow' means.

Backup: make an image file of a 500gb HDD that Linux is installed on, saving that image on a 2TB drive

Restore: output that file onto a 640GB HDD that I want to have around as a backup

?
 

·
Premium Member
Joined
·
6,819 Posts
Quote:
Originally Posted by willis888 View Post

Thanks mushroomboy. I wonder if backup and restore mean what I think they mean, and I can't even guess at what 'grow' means.
Backup: make an image file of a 500gb HDD that Linux is installed on, saving that image on a 2TB drive
Restore: output that file onto a 640GB HDD that I want to have around as a backup
?
Grow, or make the file system fill up the entire drive. It's a term some people use. =P I think it even has it's own command, not sure. Yeah, it does! lol It's typically used for iso stuff but anyways. When you DD the drive, you make an exact image sector for sector. The problem is you might migrate to a larger drive. In that case, you just DD the image back to the large drive then use a program to expand (grow) the file system to the entire drive.

[edit] My advice would be to DD the old drive partition (sda1 or similar) to the new drive directly, don't make an image. Do the whole drive and DD it to the new drive.
 
  • Rep+
Reactions: willis888
1 - 15 of 15 Posts
Top