Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hi all, I have an idea for a backup solution, just like to see if it would actually work Note: I'm looking for a non raid solution at the moment ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    7

    Arrow Help with a backup solution


    Hi all,

    I have an idea for a backup solution, just like to see if it would actually work
    Note: I'm looking for a non raid solution at the moment

    Ideally I'd like to use my 2nd HDD as a full drive backup in case the 1st HDD dies. Then the 2nd one can replace the 1st.

    So I was thinking if I first do a full drive clone to my 2nd HDD, then use rsync to keep it updated.

    my 1st drive looks like this
    Code:
    /dev/sda5 7.8G 917M 6.5G 13% /
    /dev/sda8 645G 1.4G 611G 1% /home
    /dev/sda6 996M 35M 910M 4% /tmp
    /dev/sda3 7.8G 3.9G 3.6G 52% /usr
    /dev/sda2 9.7G 431M 8.8G 5% /var
    /dev/sda1 122M 18M 98M 16% /boot
    tmpfs 1.9G 0 1.9G 0% /dev/shm
    If I have cloned the 2nd hdd, could I then mount each partition under say /backup. eg

    /dev/sdb8 --> /backup/home
    /dev/sdb6 --> /backup/tmp
    /dev/sdb3 --> /backup/usr
    etc......

    If the main HDD ever dies then I could replace HDD2 with HDD1 and mount them as expected

    /dev/sda8 --> /home
    /dev/sda6 --> /tmp
    /dev/sda3 --> /usr
    etc.....

    Would this actually work?

    Thank you

  2. #2
    RDU
    RDU is offline
    Just Joined!
    Join Date
    Aug 2010
    Posts
    89
    Should work, I already cloned a disk using rsync (and rebuilding bootloader).
    The best way to know is to try to boot your second disk.

  3. #3
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,444
    Also, have a look at /etc/fstab.
    You will most likely have to modify it beforehand or from a liveCD, if you really want to boot from the second harddisc.
    You must always face the curtain with a bow.

  4. $spacer_open
    $spacer_close
  5. #4
    RDU
    RDU is offline
    Just Joined!
    Join Date
    Aug 2010
    Posts
    89
    In the described scenario (disk 1 failed and removed), the second disk will be the 1st, so it should be sda again and no changed needed. Also modern distro use LABEL in fstab.

  6. #5
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,444
    ..and labels would fail
    Either you give the same label to the corresponding partitions, which results in conflicts.
    Or the second harddisc has none (or other) labels, then fstab needs to be edited.
    You must always face the curtain with a bow.

  7. #6
    RDU
    RDU is offline
    Just Joined!
    Join Date
    Aug 2010
    Posts
    89
    You're right, label have to be removed from fstab. But then no edit is needed in case of 1st disk broken as the 2nd disk will be the 1st and seen as sda

  8. #7
    Just Joined!
    Join Date
    Sep 2010
    Posts
    7
    I have my current fstab file below, what changes if any would I need to make on the 2nd HDD /etc/fstab so it would boot?

    Code:
    LABEL=/                 /                       ext3    noatime,defaults,usrquota        1 1
    LABEL=/home             /home                   ext3    noatime,defaults,usrquota        1 2
    LABEL=/backup           /backup                 ext3    noatime,defaults        1 2
    LABEL=/tmp              /tmp                    ext3    noatime,defaults        1 2
    LABEL=/usr              /usr                    ext3    noatime,defaults,usrquota        1 2
    LABEL=/var              /var                    ext3    noatime,defaults,usrquota        1 2
    LABEL=/boot             /boot                   ext3    noatime,defaults        1 2
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    LABEL=SWAP-sda7         swap                    swap    defaults        0 0
    Thank you

  9. #8
    Just Joined!
    Join Date
    Sep 2010
    Posts
    7
    I did a little test in a VM, I cloned HDD1 to HDD2, I didnt mount the 2nd drive, but when I tried to restart the machine it failed. It would only boot once I deleted the contents of HDD2. Hmmmm

  10. #9
    RDU
    RDU is offline
    Just Joined!
    Join Date
    Aug 2010
    Posts
    89
    I would check changing the label based fstab by a device based fstab (using /dev/sda1, ... instead of LABEL=/xxxx

  11. #10
    Just Joined!
    Join Date
    Sep 2010
    Posts
    7
    Ill try that in my VM and report back the results. Thanks!

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •