Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

backup OEM OS or recovery partition for future reinstallation

- - - - - OEM recovery partition restore Clonezilla

  • Please log in to reply
15 replies to this topic

#1
phaolo

phaolo

    Member

  • Member
  • PipPip
  • 195 posts
  • Joined 12-March 07

Hi, this is a generic question not limited to a single case, as I often have to deal with other people's computers.

 

What's the best method to backup an OEM OS to small images for future reinstallation? (even to a different hdd\ssd)

Possibly without user data, because that can be huge and it's better saved\updated elsewere anyway.

 

What about saving the recovery partitions? (as they contain smaller installers for everything)

 

 

I've checked the default programs, but:

- Win7 can only save the entire disk and so it needs an additional big external drive to store the images (not a cheap solution).

- Win8.x can backup the smaller recovery partition, but doesn't create images and thus needs a dedicated 16 GB USB device (basically always an additional purchase, even with available hdd or sticks).

- (no idea about Mac or Linux for now)

 

So I've tried Clonezilla and it seems good, but:

- I haven't tested a restore yet.

- cloning the entire disk to an image has the same problem of the huge size and the external drive requirement, so.. nope.

- cloning only the recovery partitions seems the best option, but I'm not sure if it will work! What about the original partition table?

  For example, I've seen a Win8 laptop with 7 default partitions :crazy: .. how could I ever restore those to a new empty hard drive? (unless I only need 1)

 

 

Do you have any suggestion or advice?


Edited by phaolo, 20 May 2015 - 09:03 AM.



How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,472 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

What about saving the recovery partitions? (as they contain smaller installers for everything)
I've checked various legacy options, but:

No, you haven't :w00t: or they were not "legacy" at all :whistle:.

 

Basically a partition is (the name says it all) an area of the hard disk, that has a beginning and an end address.

These start and end address are recorded in an indexing structure that is a partition table (which is in the MBR or in the first few sectors after it for GPT).

So, if you need a part of a whole, you just copy that part and (advised, but not strictly necessary in all scenario's) the information telling you where that part is located (in order to re-collocate it in the same position when restoring or recovery).

All you really need is a program capable of copying the sectors from one device to a file, i.e. the traditional (if you want "legacy") UNIX program dd (or any port, derivative or tool having the same capabilities, under Windows I personally use dsfo/dsfi) and *any* program capable of interpreting the indexing data (the partition table).

 

 

Everything else or "more" that dd (+ a partition table viewer) are (often "nice" but also sometimes "not perfect") feature-filled "overstructures" (user friendly and what not) around these functionalities:

  1. understand which and where is the area (i.e. be capable of reading and interpreting the information)
  2. copy it
  3. understand where it is needed to copy it back

More than the original partition table (which may or may not be relevant, as the information for the partition is anyway in the volume's filesystem BPB ) in the case of the MBR making a backup of it is often VITAL (in the case of these PC's with "recovery partitions") because besides the DATA (i.e. the partition table and the Disk Signature) the CODE contained in it may be "custom" and not easily replaceable, see as an example:

http://www.msfn.org/...d-not-be-found/

 

As well some of the so-called "hidden sectors" in a MBR style disk may contain part of the booting code.

 

So the Rule of the thumb is:

  • make a copy of the disk from sector 0 (the MBR) up to the beginning of first partition/volume
  • make a copy of the desired partition/volume

with these data (in both MBR or GPT cases) you have all you need to restore.

 

jaclaz

 


  • phaolo likes this

#3
phaolo

phaolo

    Member

  • Member
  • PipPip
  • 195 posts
  • Joined 12-March 07

Oh hello Jaclaz!

We always meet in these forums XD

 

 

No, you haven't :w00t: or they were not "legacy" at all :whistle:.

Uh.. oops, I've probably misused the term "legacy". I meant the default MS programs, not the obsolete ones :P

 

 

[..]Everything else or "more" that dd (+ a partition table viewer) are (often "nice" but also sometimes "not perfect") feature-filled "overstructures"

[..]in the case of the MBR making a backup of it is often VITAL (in the case of these PC's with "recovery partitions")

[..]As well some of the so-called "hidden sectors" in a MBR style disk may contain part of the booting code.

 

So the Rule of the thumb is:

  • make a copy of the disk from sector 0 (the MBR) up to the beginning of first partition/volume
  • make a copy of the desired partition/volume[..]

Ah, useful info, thanks.

 

However, are you saying that dd/dsfo/dsfi are more reliable than a tool like Clonezilla? Should I just use those instead?

I also wonder if CZ already saves the MBR\GPT automatically (I recall some sort of message). I'll have to check it.



#4
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,472 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
Well, You Keep Using That Word, I Do Not Think It Means What You Think It Means ... ;)
http://knowyourmeme....-think-it-means
http://homepage.ntlw...pejorative.html
 
What I tried to tell you is that while most, but not all, tools are (if you like bells and whistles) working fine, those are the essential things they need to do, while any given tool may fail to get all the relevant data or get too much of them, or fail to restore in the case of a "real" full recovery (i.e. a "bare metal" one).
 
Another thing that you should be aware of is the possible issue with the format in which the data is saved.
Many tools use their own "proprietary" format for the DATA, which implies that if - for any reason - the program itself fails in the recovery you cannot use another program instead.
 
As an example, for your intended use, one of the (nice) "features" of Clonezilla, that of saving ONLY used blocks for known filesystems, and then further compress it with gzip, thus providing very compact "images" makes it not so much suitable as it is possible that a recovery partition includes some files that you need to access without restoring the image or some "checks" in unmapped areas, or *whatever*.
 
As well - and as said - a disk may well contain custom MBR+hidden sectors boot code that a tool like Clonezilla may (or may not) save/include in the image.
 
What I would do if I were you would be to do a "real" dd clone of the whole disk, test the clone to be working, then image from the clone through Clonezilla (or other program under test) the parts that you believe are needed to do a "bare metal" recovery, then zap the cloned disk and attempt the bare metal recovery through the tool of choice.
If it works, good :).
If it doesn't, place back the original disk and repeat the test with another tool.
 
jaclaz

#5
phaolo

phaolo

    Member

  • Member
  • PipPip
  • 195 posts
  • Joined 12-March 07

Well, You Keep Using That Word, I Do Not Think It Means What You Think It Means ... ;)

 

I'm.. confused now. Just tell me! XD

 

 

[..]What I would do if I were you would be to do a "real" dd clone of the whole disk, test the clone to be working, then image from the clone through Clonezilla (or other program under test) the parts that you believe are needed to do a "bare metal" recovery, then zap the cloned disk and attempt the bare metal recovery through the tool of choice[..]

Ah.. that was a loooong wall of text for: "I don't know if Clonezilla works, you'll have to try it yourself" :P

Anyway, I cannot do such test for now, unless I want to mess with my own system and risk disasters.



#6
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,472 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Ah.. that was a loooong wall of text for: "I don't know if Clonezilla works, you'll have to try it yourself" :P

 

Actually the intended meaning was

"While I am actually pretty sure that I could use Clonezilla succesfully for doing that, I pretty much doubt that you will be able to do the same" :whistle:

because I believe that what is done "automagically" in Clonezilla (unless you image the WHOLE disk) is not enough to later perform a "bare metal" recovery.

 

jaclaz



#7
dencorso

dencorso

    Iuvat plus qui nihil obstat

  • Supervisor
  • 5,837 posts
  • Joined 07-April 07
  • OS:98SE
  • Country: Country Flag

Donator

Anyway, I cannot do such test for now, unless I want to mess with my own system and risk disasters.

 

:o  Well... With all due respect, I'm really sorry, but if you cannot trust yourself enough to acquire (= create) a true, full, byte-by-byte clone of your own *offline* main machine HDD, while it's in good working order, then you'll be fully useless to help yourself if ever things do go wrong !!! :no:



#8
phaolo

phaolo

    Member

  • Member
  • PipPip
  • 195 posts
  • Joined 12-March 07

 

Anyway, I cannot do such test for now, unless I want to mess with my own system and risk disasters.

 

:o  Well... With all due respect, I'm really sorry, but if you cannot trust yourself enough to acquire (= create) a true, full, byte-by-byte clone of your own *offline* main machine HDD, while it's in good working order, then you'll be fully useless to help yourself if ever things do go wrong !!! :no:

 

No no, I've already created a full backup disk image of my hdd.

I simply don't want to try to restore it now on a working system (if it ain't broke don't fix it!).

 

My doubt is about (correcly) saving only the smaller recovery partitions in other cases (I don't even have one on my pc).

I must first understand if Clonezilla copies that MBR\GPT info automatically or if it needs the programs suggested by jaclaz.

 

Maybe I could try some partial test with normal partitions in a virtual machine (even if it would be a pain, as my pc is very old and slow).


Edited by phaolo, 27 April 2015 - 04:39 AM.


#9
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,472 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Yep, a VM would be a perfect test bed. :yes:

 

As a side note 99.9999% of (please read as *all* )  "recovery partitions" are Primary volumes on MBR disks (and of course all volumes in GPT are primary partitions) so there won't be issues in the suggested "make a copy of the disk from sector 0 (the MBR) up to the beginning of first partition/volume", but in the extremely rare (please read as non-existing) case of a recovery partition being actually a logical volume inside extended one would need to additionally save the whole chain of EMBR's.

 

jaclaz



#10
phaolo

phaolo

    Member

  • Member
  • PipPip
  • 195 posts
  • Joined 12-March 07

Ok, the answer to the last problem is here in the official forums.

Unfortunately that place seems managed only by one person, so every reply currently takes minimum 7 days. :zzz:



#11
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,472 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Ok, the answer to the last problem is here in the official forums.

Unfortunately that place seems managed only by one person, so every reply currently takes minimum 7 days. :zzz:

Well, but you are (still) in the "wrong" attitude :w00t: :ph34r:

 

You should trust NOONE and verify yourself how a tool behaves, this is not about -say - a text editor, it is about a program to which you are entrusting all your data, something that should an emergence occur may make the difference between a minor hassle and a catastrophic disaster.

 

Additionally saving a bunch of sectors (normally between 63 and 1024) takes less than 1 (one) second on a modern machine and even on the slowest hardware or storage subsystem it can take at the most a few seconds.

 

Consider it an additional (hopefully redundant) safety.

 

jaclaz



#12
phaolo

phaolo

    Member

  • Member
  • PipPip
  • 195 posts
  • Joined 12-March 07

You should trust NOONE and verify yourself how a tool behaves[..]

Additionally saving a bunch of sectors (normally between 63 and 1024) takes less than 1 (one) second[..]

Consider it an additional (hopefully redundant) safety.

jaclaz

Well, I'm still looking for info, because I cannot basically test that restore and I already have a full disk image of my system.

Anyway ok, until I'll able to do it, I'll save also the MBR\GPT.


Edited by phaolo, 19 May 2015 - 04:28 PM.


#13
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,925 posts
  • Joined 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Donator

If you make a disk image of a Windows OS on GPT disk, including the EFI partitions, you may experience a problem booting the OS if you redeploy the image to a disk of a different size. This happens (for sure) with Windows 7, not sure about Windows 8.x. There may be a way to fix that after the fact, I never looked into it.


MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg


#14
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,472 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

If you make a disk image of a Windows OS on GPT disk, including the EFI partitions, you may experience a problem booting the OS if you redeploy the image to a disk of a different size. This happens (for sure) with Windows 7, not sure about Windows 8.x. There may be a way to fix that after the fact, I never looked into it.

Yes/No.

 

Of course (thanks to the stupid way GPT is designed) the secondary GPT tables will be m00t when you use "simple" or RAW imaging tools (since the GPT uses "relative negative addresses"   :w00t: :ph34r: from the END of the device).

http://en.wikipedia....Partition_Table

400px-GUID_Partition_Table_Scheme.svg.pn

 

These might need to be recreated in the appropriate location, as an example using gdisk 

http://www.rodsbooks.../repairing.html

commands r d

 

Very likely the Commercial "automagic" tools have provisions to move the tables where appropriate at restoring time.

 

Just another way to have something more complex than needed without any actual *need* or *benefit*.

 

jaclaz


Edited by jaclaz, 20 May 2015 - 07:54 AM.


#15
phaolo

phaolo

    Member

  • Member
  • PipPip
  • 195 posts
  • Joined 12-March 07

If you make a disk image of a Windows OS on GPT disk, including the EFI partitions, you may experience a problem booting the OS if you redeploy the image to a disk of a different size. [..]

Yes/No [..] the secondary GPT tables will be m00t when you use "simple" or RAW imaging tools [..] These might need to be recreated in the appropriate location, as an example using gdisk [..]

But.. if the system cannot find the duplicate GTP, what does it do? Do you mean that it doesn't simply recreate it from the first copy automatically?  :thumbdown


Edited by phaolo, 20 May 2015 - 09:47 AM.


#16
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,472 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

But.. if the system cannot find the duplicate GTP, what does it do? Do you mean that it doesn't simply recreate it from the first copy automatically?  :thumbdown

 

Hard to say. :unsure:

 

The (did I say stupid) EFI/UEFI/GPT specifications (just like any other specification) are about how things should be, not how an OS should react if anything is not as it should be according to the specifications.

 

The generic idea of a "second copy" of something is that it should be used if the first copy is not good, but, although a GPT partition entry does have a "verify hash" that should (or could) be used to detect data corruption in the entry itself, it is just a self-referencing check (useful, but not foolproof) which leaves us with the fact that if the first copy is not good (though valid regarding the hash), there is no real way to know if not by comparing with the "second copy", if the first copy is actually different from the second copy and the OS would automatically update the second copy to reflect the content of the first one the whole idea of the second copy as a "reference" would be m00t. :( 

 

To give you an example of a similar mechanism (but opposite), the FAT have usually two copies that may go "out of sync" (for whatever reasons) and you usually need to run a specialized program to fix the issue or, more commonly, a NTFS volume on a partitioned device has (outside the volume but inside the partition) a copy of first sector of the bootsector.

In case the second copy of the bootsector is missing or corrupt running CHKDSK will - if I recall it correctly - recreate it but windows will boot (or the volume will be mounted) normally.

In case the first copy of the bootsector is missing or corrupt windows won't boot (or the volume won't be mounted) normally, still there is not (and it's a good thing that there isn't) an automatic mechanism to fix the first copy and you will need to restore manually from the second copy or use (say) TESTDISK to the same effect.

 

But in that case it is a "plain" backup or "emergency provision", a NTFS volume on a non-partitioned device (super-floppy) has NOT the second copy.

 

It is entirely possible that someone has read the specifications in such a way that an OS *needs* both copies of the partition entries. :ph34r:

 

Actually (though I have never experienced the issue Tripredacus reports) it is only too logic that a "sensible" OS when finding something that is not exactly as it should be would throw an error of some kind, I was only pointing out what definitely cannot be achieved by a "RAW" copy restored to a media with a different number of sectors in the case of a "GPT style" disk, it is possible that the issue reported comes from *something else*.

 

jaclaz







Also tagged with one or more of these keywords: OEM, recovery partition, restore, Clonezilla

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users