Understanding oem partitions

Talk about other linux distributions, or even other OSes.
Post Reply
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Understanding oem partitions

Post by mimosa »

My wife has just acquired a Thinkpad with Windows 7 on it - she took it with her to a conference, so I don't have it in front of me. Before she left I had a quick look and it seems to have four partitions, the 100MB one, a massive "Windows" partition visible as the C drive, and *two* more-or-less hidden partitions of 30 GB or so that seem to have something to do with recovery; the first one of these appears to be a logical partition, but Windows won't let me see the extended partition within which it must surely lie. Also, the fourth partition appears to be primary - I didn't realise that was possible. That's based on Windows' own partitioning software - I didn't have time to boot live and use Linux tools to investigate further. I had to take my wife to the airport.

A lot of searching has turned up numerous quick and dirty fixes to get rid of this stuff, but I'd like to understand how it works first; my inclination is also to alter it as little as possible, because my wife will be cross if I brick her new box. I find it quite comforting to think I can return the machine to factory condition if need be - that is, the way it was in the shop.

However, if I can get at that extended partition, I'd like to shrink the main Windows partition and create some more. In fact, I already successfully shrank C:\\, but of course at the moment I can't put anything in the empty space. My favoured scheme is a small OS partition, one for Windows data, and one for backup. And maybe one more for Salix :D but that's not essential because I can run rsync or whatever from a Live USB. I don't expect to use the laptop, just maintain it.

During my searching I also came across dire warnings that messing with these hidden partitions could cause a mess.

To sum up, I don't have the option of just doing a fresh install of Windows after repartitioning, because the manufacturer doesn't provide a Windows install disk. So I need to be careful.

I'd be grateful to hear any pointers anyone has! This scheme seems to be quite common nowadays on new machines, but in two or three hours of searching, I couldn't find a clear explanation of how it is supposed to work or what it's for (apart from to stop the hoi polloi dual booting with Linux :evil: ).
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Understanding oem partitions

Post by gapan »

Use dd from a live CD to backup the entire hard drive to an external hard drive and then feel free to tweak it as much as you like. You can use dd on entire hard drives (e.g. /dev/sda), not just partitions. In case you mess up, you can dd the entire hard drive back. Compressing the resulting img file with gzip will help not having a huge .img file mostly filled with zeros. ;)
Image
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Understanding oem partitions

Post by mimosa »

Thanks gapan. That compression works on the fly, doesn't it? I think the disk is 500GB of mostly zeroes, and I have no other medium close to that size to back it up to.

I'm still curious to understand how this monster is actually supposed to work :mrgreen:
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Understanding oem partitions

Post by gapan »

Yes.

Code: Select all

dd if=/dev/sda | gzip > disk.img.gz
It will probably take a while.
Image
Image
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: Understanding oem partitions

Post by JRD »

As I said in the french forum, you can create recovery, kinda-live CD, from your OEM windows. It's another way of fixing things without using the resotre-all method with "dd". Seems that some windows bootloader (at least Vista) is using blocks seeking, like LILO, mixing with other obscure techniques. So this "recovery CD" can help you if you resize the windows partition, or delete the hidden (and useless) partitions.
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Understanding oem partitions

Post by mimosa »

But as a last resort, an image of the whole disk created with dd will still work, right? To guard against data corruption, I'd make two and compare them byte by byte.

You say the hidden partitions are useless. Doesn't Microsoft even have an excuse for their existence?

This would certainly have been enough to put me off a few years ago when I was trying my first dual boot (and I imagine most new users prefer that to wiping Windows, because after all, they don't know if Linux is any good yet). It unsettles me even now, because although I have no more use for Windows, my wife and daughter remain utterly dependent. When it's someone else's machine, you can't take any chances, and you have to respect their choices.

The combination of OEM (no install disk you could use *after* partitioning) and Vista / 7 partition hogging seems like it's designed to stop the sheep leaving the fold. Also that thing of putting vital system files bang in the middle of the main Windows partition, so even if you manage to resize it, you're stuck with at least half.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Understanding oem partitions

Post by mimosa »

Two points to add:

1) Resizing Windows again after a while allows you to make it smaller, I suppose because the troublesome files have got shifted around somewhere closer to the middle of the thing. After three or four such resizings (using WIndows 7's own tool) I have it down to around 150GB, and I suspect it'll shrink more if I have another go. Most of that's still empty space, but I freed up over 200GB for Other Stuff

2) A tool called Partition Wizard allows you to create extra logical partitions (and even I believe turn extended into logical) so if you want to keep the two "useless" partitions, all you need is some free space. In the case of my wife's Lenovo, my research indicates that the final partition (second of the useless ones) needs to be a primary. The third is already logical (within an extended partition of the same size). So I created a fifth partition in the empty space freed by shrinking partition 2, the main Window partition. I've just used it for data and not installed Linux, so I'm not sure about booting issues, but there must be plenty of info online.

The first, very small boot partition (100MB or so) apparently also must be primary. On my machine, partition three contains a useful-looking collection of drivers.

Note that it is important to use the Partition Wizard bootable CD. The tool can apparently also be installed within Windows, but is then less powerful. See the link in the second post here:

http://www.sevenforums.com/general-disc ... oblem.html

This also looks interesting on how to do a clean reinstall of Windows on an OEM machine:
http://www.sevenforums.com/tutorials/21 ... s-7-a.html
though I haven't tried it.

In all cases, it's obviously a good idea to use the OEM tool to create a restore disk, as well as dd to create a disk image, as gapan suggested, and backing up user data.
Post Reply