Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: What's the best tool for backing up / restoring partitions to / from image files?

  1. #1
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    795

    Default What's the best tool for backing up / restoring partitions to / from image files?

    As I said on other threads, I'm always paranoid about something happening and breaking my system (specifically its ability to boot). Although I use Yast - System Backup to create backups of installed packages and their data, I won't feel safe until I can also create images of my openSUSE partition which I can keep on other drives. In Windows 7 I used Macrium Reflect which did its thing well, but now I need an alternative for SUSE.

    I already found one called dd, and am currently cloning my partition with the command "dd if=/dev/sdb3 of=/windows/D/System/sdb3.img" which appears to be working well. But this has a big issue: It creates a file the same size as the partition, instead of saving just the data. My openSUSE partition is 177 GB large, but currently filled up to 50 GB. Therefore about 125 GB of disk space (as well as the backup time) are being wasted to save nothing, which I don't want to go with unless no other option exists. Someone on IRC explained that dd doesn't know about file systems and can only store partitions as a whole. If so, is there any tool that does and can backup / restore partitions to / from images?

    Something else I'd like clarified about partition cloning; Many suggest doing it with a live DVD, but I really prefer to leave the backup tool running while I'm away and sleeping for instance, without booting into something else each time. The problem I heard about is that a partition might be saved as corrupted if it's modified during the backup. Since I'm backing up from the openSUSE installation located on the partition I'm backing up, I likely can't set it as read-only (that would be like setting C:/ read-only while Windows is running). Do partition backups get corrupted if data on them is modified while they're being saved? If so, is it possible to set all hard drives to read-only while openSUSE is running and backup to an external drive during that time? I know that means no application can save or modify anything (and some programs might even crash), but if I do this while I'm sleeping it doesn't bother me.
    openSUSE Tumbleweed x64, KDE Framework 5

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,006
    Blog Entries
    14

    Default Re: What's the best tool for backing up / restoring partitions to / from image files?

    I'm beginning to doubt your setup. It looks like you have a single partition openSUSE setup of 177 GB. The installer will always suggest a separate /home partition. The big advantage is that you keep ./home at a next install.
    The one thing you IMHO should do, is backup your entire /home, reinstall 12.2 and create three partitions
    2 GB of swap
    25 GB for /
    the rest for /home.
    Then, after install you restore the content of the backupped /home to the newly created partition mounted on /home

    That would allow you to install, reinstall, update, upgrade without touching your /home.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3

    Default Re: What's the best tool for backing up / restoring partitions to / from image files?

    I like dar. I use it on my 11.3 system. I have not checked if it is available for 12.2. It is a file aware backup and runs under the system that is being backed up. It can restore to a different partition format and you can restore individual files. What it does not do is restore the partition structure and MBR. If as part of your backup you record the partition structure and know how to recreate the grub MBR all should be well. You also need a bootable system on USB or CD to recreate and format partitions and this must include a working version of dar.

    I typically will use firefox while running a dar backup and never had any problems. However if you do too much you will likely have inconsistent ( but not corrupt ) files rather than a corrupt file system

    I have not checked the availability of dar on 12.2 or its ability to work with UEFI based systems

  4. #4
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    795

    Default Re: What's the best tool for backing up / restoring partitions to / from image files?

    @ Knurpht: Yeah, I never used a separate home partition. Back when I did the partitioning for my drives I didn't even know why Linux would suggest such a thing. I like this setup though... even if backing up the system can be a bit more problematic. My home folder is closely related to installed applications, so it feels ok to have both on the same partition. If I ever change my partitioning drastically though, I might reconsider this.

    @ vindevienne: I don't need the MBR backed up. Especially since my system is dual-boot with Windows 7, and restoring the bootloader like that could likely be problematic. If I'd ever have to restore a partition backup, what I'd do is wiping / formatting the openSUSE installation's partition, then restoring the backup image to it. GRUB isn't aware of this so normally it should boot the same way after that. If not, is it possible to use the installation DVD, re-detect operating systems and generate a new GRUB setup?

    As for dar, I see it in the repos for 12.2. Might try it out if it works for what I want. Keep in mind I do want to make a full partition backup (not just copy my files to an archive) which can be used to restore the entire OS to an empty partition. With the only exception of not wasting 125 GB to also store the unused area of that partition Someone also mentioned partimage, but I don't see it in the repos.
    openSUSE Tumbleweed x64, KDE Framework 5

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: What's the best tool for backing up / restoring partitions to/ from image files?

    On 2012-09-25 22:46, MirceaKitsune wrote:
    >
    > As I said on other threads, I'm always paranoid about something
    > happening and breaking my system (specifically its ability to boot).
    > Although I use Yast - System Backup to create backups of installed
    > packages and their data, I won't feel safe until I can also create
    > images of my openSUSE partition which I can keep on other drives. In
    > Windows 7 I used Macrium Reflect which did its thing well, but now I
    > need an alternative for SUSE.


    Backup software for Linux is not that "cute" as Windows software. And sometimes very below par
    - I compare with PCTools Backup from the 80's 90's, for MSDos. I sorely miss the ability to
    compress with verification and with error recovery data.


    > I already found one called dd, and am currently cloning my partition
    > with the command "dd if=/dev/sdb3 of=/windows/D/System/sdb3.img" which
    > appears to be working well. But this has a big issue: It creates a file
    > the same size as the partition, instead of saving just the data. My
    > openSUSE partition is 177 GB large, but currently filled up to 50 GB.
    > Therefore about 125 GB of disk space (as well as the backup time) are
    > being wasted to save nothing, which I don't want to go with unless no
    > other option exists. Someone on IRC explained that dd doesn't know about
    > file systems and can only store partitions as a whole. If so, is there
    > any tool that does and can backup / restore partitions to / from images?


    Well, dd does a blind and exact image. Advantages: it restores all, even the non used sectors
    where grub resides, so it restores booting. For example, if you have grub on a small /boot
    partition, say 200 MB, saving it with dd is an advantage. It is the most reliable tool.

    For big partitions, non bootable, clonezilla does a good job. It does not save unused sectors,
    and it also does compressing. Another similar tool is SystemRescueCd (the one I use).


    > Something else I'd like clarified about partition cloning; Many suggest
    > doing it with a live DVD, but I really prefer to leave the backup tool
    > running while I'm away and sleeping for instance, without booting into
    > something else each time. The problem I heard about is that a partition
    > might be saved as corrupted if it's modified during the backup. Since
    > I'm backing up from the openSUSE installation located on the partition
    > I'm backing up, I likely can't set it as read-only (that would be like
    > setting C:/ read-only while Windows is running).


    You simply can not do an image backup of a mounted partition. Forget it. At best, when you
    recover it and attempt booting, the system will have to fsck it and find lots of broken sectors.

    Halt the computer, boot the dvd or usb stick, and do the image backup.


    > Do partition backups
    > get corrupted if data on them is modified while they're being saved?


    Always. Absolutely.

    > If
    > so, is it possible to set all hard drives to read-only while openSUSE is
    > running and backup to an external drive during that time?


    No.

    > I know that
    > means no application can save or modify anything (and some programs
    > might even crash), but if I do this while I'm sleeping it doesn't bother
    > me.


    It will. The machine would not work the next day when you get up, forcing a reboot.

    You can do an rsync backup, and this will also have problems.


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  6. #6
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    795

    Default Re: What's the best tool for backing up / restoring partitions to/ from image files?

    Ok. Sucks that you have to use a live DVD each time... I was hoping I could leave the backup tool running while I'm sleeping and find it done in the morning (dd didn't warn me about any errors). Might look into Clonezilla in this case.

    Anyway, I'm currently looking at how dar works, as it apparently saves the entire drive to a special type of archive. Is it possible to save the entire partition to it, and if needed restore it to a fresh / formatted ext3 partition and be able to boot Linux from there like nothing happened (after re-configuring GRUB if necessary)?

    Also, can the installation DVD of openSUSE be used to scan the drive for operating systems and re-generate a GRUB setup, without modifying anything else? Would be helpful in the event of such a restoration.
    openSUSE Tumbleweed x64, KDE Framework 5

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: What's the best tool for backing up / restoring partitions to/ from image files?

    On 2012-09-26 01:56, MirceaKitsune wrote:
    >
    > Ok. Sucks that you have to use a live DVD each time... I was hoping I
    > could leave the backup tool running while I'm sleeping and find it done
    > in the morning (dd didn't warn me about any errors). Might look into
    > Clonezilla in this case.


    There are two problems while backing up an image of a mounted partition. One, is that files can
    be caught at the middle of writing operations: some you will catch empty, others half written,
    others inconsistent... and maybe more cases I forget about.

    Another is that the metadata of the disk is partly in memory, partly modified. For example, a
    file might be using records 1, 2, 5, & 7, but this might not still be written on the disk. When
    you try to mount a restored image in this state the system detects that it was not closed
    properly and will do an fsck on it - which might succeed or not, there is always some danger of
    lost files.

    It is possible to do it, there are machines where that is the best that can be done, because
    the machine is not stoppable. I know of a machine where what they did was disconnect one half
    of a raid disk, backup that half while the first half kept the system working, and then
    reassemble the raid.


    > Anyway, I'm currently looking at how dar works, as it apparently saves
    > the entire drive to a special type of archive. Is it possible to save
    > the entire partition to it, and if needed restore it to a fresh /
    > formatted ext3 partition and be able to boot Linux from there like
    > nothing happened (after re-configuring GRUB if necessary)?


    Dar will not restore the boot sectors, I think. It backups files.

    >
    > Also, can the installation DVD of openSUSE be used to scan the drive
    > for operating systems and re-generate a GRUB setup, without modifying
    > anything else? Would be helpful in the event of such a restoration.


    I'm not sure if I understand.


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  8. #8
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    795

    Default Re: What's the best tool for backing up / restoring partitions to/ from image files?

    Quote Originally Posted by robin_listas View Post
    There are two problems while backing up an image of a mounted partition. One, is that files can
    be caught at the middle of writing operations: some you will catch empty, others half written,
    others inconsistent... and maybe more cases I forget about.

    Another is that the metadata of the disk is partly in memory, partly modified. For example, a
    file might be using records 1, 2, 5, & 7, but this might not still be written on the disk. When
    you try to mount a restored image in this state the system detects that it was not closed
    properly and will do an fsck on it - which might succeed or not, there is always some danger of
    lost files.

    It is possible to do it, there are machines where that is the best that can be done, because
    the machine is not stoppable. I know of a machine where what they did was disconnect one half
    of a raid disk, backup that half while the first half kept the system working, and then
    reassemble the raid.
    Makes sense. Hope some way to properly backup this way will eventually exist. Might go for Clonezilla in the meantime.

    Quote Originally Posted by robin_listas View Post
    Dar will not restore the boot sectors, I think. It backups files.

    Yes, not boot sectors. But for example: Can I use dar to backup the entire openSUSE partition? Then if something bad happens restore it to a freshly formatted ext3 drive, then use the installation DVD to re-detect operating systems on drives and generate a new boot configuration.

    Quote Originally Posted by robin_listas View Post
    I'm not sure if I understand.
    What I said above. I was wondering if I can insert the openSUSE DVD, boot it, then use a tool located there to detect operating systems and generate a new GRUB. When you install SUSE for the first time, a bootloader setup is generated. But I'd need to regenerate only that bootloader without changing anything else.
    openSUSE Tumbleweed x64, KDE Framework 5

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: What's the best tool for backing up / restoring partitions to/ from image files?

    On 2012-09-26 10:56, MirceaKitsune wrote:
    >
    > robin_listas;2490577 Wrote:



    >
    > Makes sense. Hope some way to properly backup this way will eventually
    > exist. Might go for Clonezilla in the meantime.


    Only partial solutions are possible.

    For example, a running database may have a feature to make a dump of the database to an
    external backup file in a consistent state. For example, all incoming modifications are written
    to another file while the central database is stabilized, then copied, and finally the
    modifications that were written externally are committed to the central database. I have worked
    with such a system.

    But it is a partial solution.

    You have to stop all running applications, office applications, graphical editors, email
    daemons, log writing... absolutely every thing! Then copy that partition somewhere else, and
    fast, for backup. This is not doable with a general purpose operating system.



    > robin_listas;2490577 Wrote:
    >>
    >> Dar will not restore the boot sectors, I think. It backups files.
    >>

    >
    > Yes, not boot sectors. But for example: Can I use dar to backup the
    > entire openSUSE partition? Then if something bad happens restore it to a
    > freshly formatted ext3 drive, then use the installation DVD to re-detect
    > operating systems on drives and generate a new boot configuration.


    Perhaps...

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  10. #10

    Default Re: What's the best tool for backing up / restoring partitions to/ from image files?

    I've used Clonezilla with good results.
    It can also be found in the Parted Magic cd together with other back up tools.

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

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