[ale] replacing disk sda

Preston preston.lists at gmail.com
Tue Apr 22 11:17:29 EDT 2014


On 4/18/2014 5:02 AM, Paul Cartwright wrote:
> ok, well my error count went to 31 sectors on /dev/sda the other day..
> I've been rcping /home over to a partition on sdb, so this morning,
> before I opened email, I edited /etc/fstab, commented out /home, moved
> my partition on /dev/sdb to /home and.... rebooted. SO, I didn't get
> that error I have been getting where it always drops me to that enter
> password or Control-D to continue, it just flat booted:)
>
> so now I have an /dev/sda with .. nothing mounted . /dev/sda3 is my
> windows 7 partition, sda2 I think is the Dell recovery partition, I
> forget what sda1 is..
> Yesterday I did a clonezilla disk copy of /sda to a spare partition on
> sdb. It errored on my /dev/sda5 /home but copied the other partitions.
>
> I also have a nice new 2TB drive sitting here in a box. If I just
> replace the old 1TB drive with the new 2TB drive and do a clonezilla
> restore, will I be able to boot to grub menu? does it copy the MBR?
> suggestions/comments?? am I missing something??
>
(sent to both you and ALE)

I love Clonezilla.  It should do all you need.  You might have to use
Gparted or something to expand the new drive after Clonezilla is
finished since it will think it's only the size of the original disk (or
it used to it seems).

I use sfdisk (/sbin/sfdisk) to back up the mbr:

    /sbin/sfdisk -d /dev/sda > /<backup directory>/mbr-backup-`date
+%Y-%m-%d`.bak

and fsarchiver to back up everything else on my running system:

    fsarchiver -A -a -v -j2 -o savefs /<backup
directory>/system-backup-`date +%Y-%m-%d`.fsa /dev/sda1

My switches tell fsarchiver to:
    -A            do a live backup of a mounted system
    -a            don't worry if the partition is mounted without
acl/xattr options
    -v            be verbose (sometimes don't use this)
    -j#          use multi-core cpu (i use 2 cores)
    -o            overwrite the archive if it exists instead of failing

I use the date command to keep track of when the backup has run.

I really like how fsarchiver "doesn't care" about the size of the disk
you are putting it back onto when I do a recovery.  As long as it fits,
you're good (in my experience).

I run the following on Ubuntu/Debian systems with the sudo command or as
root (yes I like to live on the edge).

***<begin my simple bash backup script>***

#!/bin/bash

clear

echo "cleaning apt cache\n"

apt-get clean

echo

echo "sfdisk is backing up the mbr\n"

/sbin/sfdisk -d /dev/sda > /backup-directory-here/mbr-backup-`date
+%Y-%m-%d`.bak

echo

echo "fsarchiver is backing up system\n"

fsarchiver -A -a -v -j2 -o savefs
/backup-directory-here/cool-system-name-backup-`date +%Y-%m-%d`.fsa
/dev/sda1

echo

echo "rsync is now making a copy of the fsarchive image\n"

rsync -avh --progress /backup-directory/ /other-backup-directory/

echo

echo "alright.  we're done here.\n"

echo "$wipe"

***<end my simple bash backup script>***

I run that as a cron job and have it keep only the last several (it's
backing up my media server so i'm only looking at 3-4 Gig backups).

directory/partition names were changed to gloss over my childlike admin
skillz.

Have a good one.

Preston

-- 
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
-Dr. Seuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20140422/2098504a/attachment-0001.html>


More information about the Ale mailing list