Safe to Restore MBR/Sector 0?

Discussion in 'Acronis True Image Product Line' started by Juan Largo, May 23, 2008.

Thread Status:
Not open for further replies.
  1. Juan Largo

    Juan Largo Registered Member

    Joined:
    May 23, 2008
    Posts:
    3
    Hello,

    I've been using Acronis True Image 11.0 and I had to restore a partition image yesterday. The partition was a Linux OS with the boot loader code installed in the Boot Sector of the partition.

    When I did the restoration, I identified the partition image (the .tib file) that I wanted to restore. Then, immediately a dialog box opened where I had a choice of restoring a) the partition image, and b) the MBR (Sector 0). I selected the partition image, but not the MBR. (The MBR goes at the beginning of the disk, before the first partition. I didn't want to overwrite that.)

    After the restoration was complete, I wasn't able to boot into the Linux partition. I had to manually re-install the boot loader on the Boot Sector before I was able to boot.

    Question: When Acronis 11.0 makes a partition image, does it create a separate image the Boot Sector of the partition in addition to the files and directories of the partition? Should I have selected to restore the "MBR" in addition to restoring the partition itself? I didn't want to overwrite the MBR at the beginning of the disk; I only wanted to restore the Boot Sector at the beginning of the Linux partition.

    The terminology "MBR" is a bit misleading. I did want to restore the Boot Sector, but I didn't want to overwrite the MBR.
     
  2. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,481
    Location:
    California
    If you were using GRUB, it can be fussy about not being restored back into the same sectors.

    Next time, try restoring the Linux partition using the Sector-by-Sector mode and see if it boots properly. This worked for me on my tests. Note that the image doesn't need to be created in Sector-by-Sector mode.
     
  3. Juan Largo

    Juan Largo Registered Member

    Joined:
    May 23, 2008
    Posts:
    3
    Thank you, MudCrab! I'll try the sector-by-sector restore next time. I didn't realize that I could do that without creating a sector-by-sector image first.
     
  4. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    A partition image contains all of the used sectors in the partition, including the first few where the partition's boot sectors are located.

    There is an oddity about TI. When it restores Linux-formatted partitions, it zeros part of the first sector of the partition. If you had GRUB installed to a partition boot record, then it gets whacked by TI when restored. I forget the reason that this is done - I think it may have had something to do with requirements of the other popular Linux loader, LILO. But it's kind of annoying to have TI do that to GRUB. After restoration you need to reinstall GRUB to the partition's boot record by using a Linux repair CD to fix it.

    Or, like MudCrab says, if you have TI 11 try the sector-by-sector restore to prevent this from happening.

    I'm fairly certain that this is a TI issue, not a GRUB issue. I'm going by memory but I remember having GRUB installed to the MBR a couple of years ago. I could restore the MBR with TI and GRUB would still work afterwards without needing a repair. But move it to a partition boot record and it won't survive restoration.
     
  5. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    This has happened to me before. And here is the quickest solution:

    Download SuperGrub from:

    http://supergrub.forjamari.linex.org/?section=download

    If that ever happens to you again, simply boot the SuperGrub CD and restore GRUB to wherever you want. Total process = 2 minutes, and you up and running again as normal.
     
  6. Juan Largo

    Juan Largo Registered Member

    Joined:
    May 23, 2008
    Posts:
    3
    Hi Mark,

    You hit the nail on the head. I do have GRUB installed on the Linux partition instead of the MBR since I chain load into Linux from Windows. I never ran into this problem until I starting using Acronis TI 11. It's unfortunate that TI 11 zeros out the boot sector during the restore. I wonder why.

    Anyways, I'll try the sector-by-sector approach the next time I'm forced to do this drill. If it works, great. If not, I'll just have to repair GRUB, which isn't a big deal -- just a little annoying.

    Thanks. I'll add this to my toolbox.
     
  7. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    Yes good idea. SuperGrub has helped me so many times. Its one of those programs now that are a must be in my collection.

    SuperGrub is great and it helps to restore MS Vista and MS Windows boot sectors, removes Grub properly and restores Grub if needed too.

    It does a lot of things.
     
  8. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello all,

    Many thanks for choosing Acronis Backup software.

    As a matter of fact the most of the Linux loaders are made in such a way that they are assigned to the exact hard disk drive sectors. So if you restore the image in a usual way most likely Linux Loader will not correspond to the exact sectors it was assigned to when the image was created. But if you restore the image in sector-by-sector mode as MudCrab suggested Linux Loader should be restored correctly as it'll be assigned to the same sectors it was assigned to when the image was created.

    Thank you
    --
    Nikita Sakharov
     
  9. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    Does a sector-by-sector mode backup make an image of the whole hard drive? For example, I have an 120GB HDD, but it only contains 15GB of data.

    So if I did a sector-by-sector mode backup, would the image be 120GB in size and it would backup even empty sectors where no data exists?
     
  10. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,481
    Location:
    California
    Per the TI 11 User's Guide, page 28:
    However, you can restore in Sector-by-Sector mode without having created the backup using that mode.
     
  11. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Is this, then, a correct summary of how TI 11 operates?

    When creating an image:

    Normal mode - back up only in-use sectors. Keep track of their original location.
    Sector-by-sector mode - back up all sectors, whether used or not.

    When restoring an image:

    Normal mode - Place files contiguously, into perhaps different sectors than originally stored in, resulting in a defragmented file structure.
    Sector-by-sector mode - Place all sectors in their original locations.
     
  12. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,481
    Location:
    California
    I assume that's how it is supposed to work. I haven't done any specific tests on it, though.

    The main thing I've used the Sector-by-Sector mode for is to restore Linux partitions so they will boot.

    There may still be a difference between a backup created with Sector-by-Sector mode and then restored in Sector-by-Sector mode and a Normal backup that is just restored using Sector-by-Sector mode.

    Since this mode is supposed to work with encrypted partitions, I have to assume that everything is put back where it was. Otherwise, I don't see how it could work or what purpose it would serve.
     
  13. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    That doesn't make sense. How can you restore something from a backed up image file that doesn't exist?
     
  14. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    Does it matter? After the restore we can always defrag.
     
  15. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    It makes perfect sense. You only restore the in-use sectors to their previous locations. The other sectors are unallocated and their contents are irrelevent.

    Defragmenting after a normal restore is unnecessary because of the way files are restored. Check your disk immediately after restoration - you will find everything packed in nicely and efficiently. The only problem is that TI does not put the MFT in its optimum location, but that's another issue.
     
  16. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    No it doesn't make logical sense what you said. The reason I say that is because if a person uses normal backup and the image is let's say 5GB (compressed) from the original 10GB of data, then that image file cannot contain the "empty data" from the whole HDD because it never read it in the first place as it wasn't told to do a sector-by-sector backup. So your reasoning is flawed.

    And to be honest I have not checked that regarding the defraging. But I regularly defrag my HDD daily anyway using Auslogics Defrag.
     
  17. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    8,634
    Location:
    NSW, Australia
    k0lo,

    I haven't checked. Does the graphic in PerfectDisk or Diskeeper look identical before and after a TI restore? I'd expect so. So if it's fragmented before, it will be fragmented after.
    What happens with the MFT?
     
  18. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Brian:

    No it does not look the same. If the disk is badly fragmented before a restore it will be nicely defragmented after the restore. If you have a defragmented drive with optimal file placement before a restore then you will end up with a nicely defragmented drive with non-optimal file placement after the restore.

    The Perfect Disk algorithm arranges the files on the disk optimally as follows. Boot files are moved to the outer track of the disk for best speed, the MFT is located about 1/3 of the way from the start of the disk (Microsoft's recommended "optimum" location), there is an MFT reserved zone immediately following the MFT (to allow for growth without fragmenting further), followed by the paging file, hibernation file (if used), the metadata, and then any shadow copies (if using VSS on Vista).

    After a restore the files are packed in without any fragmentation. The MFT is in an arbitrary location (not in the optimal location). The MFT reserved zone is separated from the MFT, guaranteeing fragmentation once more files are added. Also, the paging file, hiberfile, and metadata seem to end up in arbitrary locations. But there is no fragmentation right after restoring. If your disk was badly fragmented when you created the backup image, you will notice that your machine runs faster immediately after restoring the image because of the "automatic" defragmentation that takes place as files are put back on the disk contiguously.

    I normally run Perfect Disk following a restore and let it do its thing, sorting the file locations out and putting everything back in its optimal location.
     
  19. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    You're arguing semantics. That's right - a "normal" backup does not contain the data stored in the unused sectors; it only contains data stored in the in-use sectors. But go back and re-read what I said.

    If you restore a normal backup in sector-by-sector mode, all of the in-use sectors are put back exactly where they were originally located. None of the unused sectors are changed, but so what? These sectors do not contain any data from files currently on the disk. They may contain leftovers from files that used to be there but have since been deleted, but again, nothing in the file system will reference these sectors so it won't matter if they contain all zeros, all ones, or arbitrary leftover junk. Practically speaking, the end result is a disk that is indistinguishable from the disk before the backup, from the standpoint of the file system.

    Your interpretation is also correct, technically. If you do a normal backup, zero every sector on the disk, and then do a sector-by-sector restore you will end up with a disk that looks identical to the file system but will contain different data in the unused sectors.
     
  20. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    How much did Perfect Disk cost you? Do you find it a lot better than Auslogics Defrag?

    UPDATE: I just installed the 30 day trial of Perfect Disk and it reported that my HDD is "Excellent" in all tests. So it seems that Auslogics Defrag does a good job, and it's freeware too :)
     
    Last edited: Jun 1, 2008
  21. truthseeker

    truthseeker Former Poster

    Joined:
    Jan 26, 2008
    Posts:
    977
    Now this message from you makes sense :) Now you're talking :)
     
  22. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    8,634
    Location:
    NSW, Australia
    k0lo,

    That's interesting. I'll have to wait until I get some fragmentation and do the test. I use PerfectDisk but not True Image. My MFT always looks OK whenever I check Perfect Disk and I've done 3 restores in the last week.

    I'll let you know if the before and after graphic is the same.

    I'm advised that Ghost 2003 does a File Oriented restore. So if you have a grossly fragmented partition and create an image, when you restore the image, the partition will be unfragmented. Just a comment.
     
  23. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Periodically they have special sales. I got the latest version, PD 2008, on sale for $30 for 3 licenses, so that worked out to $10 per PC.
     
  24. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    I assume that something similar is done by TI when restoring in normal mode. I don't know how it determines how to arrange the files in the restored image, but they always come out contiguous, so there is no fragmentation. I assume that if you did a sector-by-sector restore that the before and after fragmentation would be the same.
     
  25. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    8,634
    Location:
    NSW, Australia
    k0lo,

    Curiosity overcame me.

    I last defragged 6 days ago so PerfectDisk showed some fragmentation. I took a screen shot and created an image. I restored the image. The PerfectDisk graphic I'm currently observing is exactly the same as the screen shot. So my app does a Sector Oriented restore. I guess True Image is doing a File Oriented restore. Like Ghost 2003.
     
Thread Status:
Not open for further replies.