Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a dedicated server with a 120gb main ssd. The server happens to come with a couple of 3000GB hard drives. I'd like to use them to back up my main drive.

Preferably, I'd like one as an exact copy of the main SSD and the other with incremental backups of the mysql database and a user uploads file.

These are the drives I have

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f2e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4196352     2097152+  83  Linux
/dev/sda2         4198400     5246976      524288+  83  Linux
/dev/sda3         5249024   234441647   114596312   83  Linux

Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/sdc doesn't contain a valid partition table

The first problem I have, is that I have no idea how to copy from one drive to another. Kind of embarrassing I know, but I don't know where to start. I'm thinking of this in terms of Mac OS cli where I'm able to copy between /Volumes - is there an equivalent?

(there is nothing under /mnt or /media)

share|improve this question
add comment

2 Answers

Exact copy (bootable in case of trouble!): dd if=/dev/sda of=/dev/sdb bs=1M from a bootable CD or single user mode will work on a modern system (we are long past true CHS geometries). The partition table on the larger disk can be extended later when the remaining space is needed. When working with dd, never confuse if and of - the damage resulting from a mistake cannot be reversed by any practical means.

Real incremental backup of mysql: Make a partition table and filesystem on /dev/sdc, set up mysql as a replication master (no need to actually replicate), and have a cron job (scheduled task) archive (and purge in mysql itself) the binary logs mysql creates automatically.

Practical backup of mysql: Just use something like automysqlbackup.sh and store more compressed full backups on a 3TB disk than you will likely ever need :)

share|improve this answer
add comment

You need to mount the drives so they will be accessible directly on the mount point.

For example:

sudo mkdir /mnt/disk1   (to make the mountpoint)
sudo mount -t ext4 /dev/sdb /mnt/disk1

If the disk sdb is formatted with ext4 but your disks do not appear to be formatted (or they are using lvm) so you need to format them with filesystem first. If they are using lvm, you mount the LV partitions using their LV names and not the whole disk.

To make the mounts permanents (not disappearing on reboot) you have to persist them in /etc/fstab (you can see man fstab for details).

To make an exact copy, you can use dd. Your main disk is 120GB only and the others are 3TB, you will have a lot of free space on it that can be used making another partition on it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.