Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Possible Drive failure.. backup??

  • 16-05-2005 11:53am
    #1
    Registered Users, Registered Users 2 Posts: 998 ✭✭✭


    Guys I've a laptop at the moment and the drive has just started clicking fairly badly.. I'm thinking its on its way out v.soon.

    I've ubuntu currently installed on it atm along with a number of installed apps and files..
    The thing is I dont want to loose this setup so I want to backup the whole drive... the thing is I've never done this with linux, with windows I'd just ghost it and throw it on another drive.

    Any suggestions on how I go about backing up the installation? so I can dump it to another drive.


Comments

  • Closed Accounts Posts: 4,763 ✭✭✭Fenster


    dd if=/dev/hda of=backup.iso

    That'll give you a CD image of the whole hard drive. There's many elegant scripted ways to do it, but that's the fast and dirty way. :p


  • Registered Users, Registered Users 2 Posts: 998 ✭✭✭zekiel


    Thanks for that.. how do I then reload it to another drive once I have it in an ISO.


  • Closed Accounts Posts: 7,562 ✭✭✭leeroybrown


    The dd solution listed above will give you an exact binary image of the data on the drive not an iso9660 (cdrom) mage. The image will also be exactly the same size as the drive. Generally I only use dd to do backups when I know I want exact binary sizes or exact backups in the case of disaster recovery.

    My suggestion would be to attach an external drive to the laptop and use tar to make a backup of the files on each partition. Alternatively you could make an archival (-a) copy with cp. It'll make it very easy to restore and will take up a lot less space. If you don't have an external drive you can just use a network share or pipe the output of tar through an ssh connection into cat to create the file on another linux box. To restore all you need to do is create a few file systems with fdisk (or the ubuntu installer), then boot with a livecd and copy the files back.

    You're also a lot less likely to do something bad accidentally when you're using cp or tar at a file system level rather than dd at a device level.


  • Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭Syth


    Once you've got the image, just dd it back:
    dd if=backup.img of=/dev/hda
    


  • Registered Users, Registered Users 2 Posts: 998 ✭✭✭zekiel


    ok so to just clarify this, I runn the dd backup command - create the image and copy it across to another machine.

    Replace the drive then run a live cd like knoppix or damn small linux and cp the image back on to that drive.

    Then run the dd restore command..

    Am I on the right track.

    One thing I'm missing from that is when I put the new drive in, do I format it?? or instead of using a live cd will I reinstall a base linux package back on it. :confused:


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,771 ✭✭✭niallb


    zekiel wrote:
    The thing is I dont want to loose this setup so I want to backup the whole drive... the thing is I've never done this with linux, with windows I'd just ghost it and throw it on another drive.

    If you've got ghost and you're used to it, use it.
    Ghost shouldn't be worried about filesystems.
    So long as you know which partition you're on,
    should be all good.(?? I've never used ghost, but
    it's true for g4u, which is supposedly quite equivalent.)

    Backing up with dd is ideal if you're transferring
    to another identical drive. Use tar otherwise.
    With dd, you've backed up the filesystem, so
    you don't need to format. With tar, you've backed
    up the files, so you do.

    dd syntax
    dd if=/dev/hda5 (or whatever your partition is) of=/mnt/backupfile.dd to backup
    dd if=/mnt/backupfile.dd of=/dev/hda5 (or whatever your partition is) to restore
    if=input file, of=output file.

    tar will work better if you boot from a CD and mount your root
    filesystem under it. If you use an ext2 (and now ext3) filesystem, dump is ancient but very good.

    If you have another machine networked, try to run the backup to it.
    Were you thinking of copying the files to the new drive in one go?

    NiallB


  • Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭Syth


    Don't copy the image back to the drive you want to restore. When you restore you will be completly recreating that filesystem and hence the image will be wiped. You don't need to reformat. (You can reformat, but by restoring you'll be wiping it all away).


Advertisement