The Lenovo X100e is a business-class netbook based on an 11.6 inch LCD screen and a full-sized keyboard. Although, performance wise, it does not sport a particularly powerful CPU it is nonetheless a sensible workstation for document production and small scale software development on the move. It is light, very portable and relatively low cost compared to Lenovo's high end X-series ultra-portable workstations. The X100e originally shipped with a Hitachi TravelStar 320 GB hard drive. However, as the prices of solid-state drives ("SSD") have come down, and in response to a requirement for increased performance and a wish to dual-boot the X100e to a rudimentary Linux installation, I have decided to upgrade the hard drive to a fresh 128 GB SSD; but not without problems.

Production of SD card based factory recovery disk

As a small form factor workstation, the Lenovo X100e does not feature an internal optical drive. Naturally, production of factory recovery disks was problematic in the absence of an optical drive with a USB interface. The Factory Restore program does, however, support the recording of a factory recovery partition in USB hard disk format to a memory device such as a memory key or an SD card. Notably, however, although the factory recovery partition can be written to an SD card, it does not appear to be possible to boot the X100e from the resultant SD card without more even though the X100e does recognize the card as a possible boot device on start up.

Unfortunately, the firmware used in the Lenovo X100e does not provide much in the way of diagnostic support: when faced with unbootable media, the machine simply displays a flashing cursor in the top left hand corner of the screen. Upon further research, it appears that the USB memory device must be initialised with a partition table, and an active primary partition using Windows 7 before it is formatted and used to record the recovery disk images: (link target entitled "New or used USB memory keys or USB flash drives require an active partition created from within Windows Visa or Windows 7 prior to making the Windows 7 Recovery media on the USB key - ThinkPad"), and (link target entitled "Creating X100e recovery media on USB stick").

Unfortunately, by the time I had found these documents, I had already "created" my recovery media on an 8 GB SD card; of which the recovery media consumes about 7.5 GB. After creation of the recovery media, it appears that the original partition on the system hard disk containing the recovery media is deleted and or marked, preventing the recovery media from being re-created. What follows, then, are the steps that I took to dervice a working factory recovery disk from a factory disk that ostensibly contained everything that a factory disk would need but could not be booted as such.

Factory recovery media file structure, and the Windows 7 startup process explained

The SD card produced by the "Create Recovery Media" function is structured as follows –

dir /a

| boot.sdi
| memtest.exe
| tag
| cs-CZ
| ...
| zh-TW
| bcdinfo.txt
| cdrivebackup.swm
| cdrivebackup2.swm
| cdrivebackup3.swm
| sdrivebackup.swm
| service_done.ini

The structure of Windows 7 bootable media

When dealing with problems involving complex interactions between hardware and software, it is often helpful to try to adopt a structured approach to problem solving by understanding the role of each component.

Master boot record ("MBR")

The boot sector, or master boot record ("MBR") is an operating system independent boot record of 512 bytes containing a combination of bootstrap code and a 64 byte partition table. The purpose of the MBR bootstrap code is to identify the "active" partition, and to load and execute the volume boot record on that partition.

The boot process for a computer operating on IBM PC compatible firmware is as follows –

  1. identify boot device;
  2. load MBR;
  3. execute MBR.

The MBR typically loads and runs the volume boot record ("VBR"), an operating system dependent boot record.

Volume boot record ("VBR")

The volume boot record ("VBR") is responsible for loading the relevant operating system boot manager. Under Windows Vista, Windows 7 and Windows Server 2008, this is "bootmgr"; whereas under previous versions of Windows, Windows NT and Windows XP, the boot manager is "ntldr".

Windows boot manager: bootmgr

"bootmgr" is the boot manager for Windows Vista, Windows 7 and Windows Server 2008. It's principal role is to –

  1. load the boot configuration data, stored in a file named "BCD";
  2. use the boot configuration data to boot the operating system.

Boot configuration data: BCD

The boot configuration data file (the "BCD File") is a firmware-independent database for boot-time configuration data and is structured in the same format as the Windows Registry; the reference to firmware relates to traditional IBM PC compatible firmware, or the newer Extensible Firmware Interface ("EFI") firmware which, along with the GUID Partition Table ("GPT") has been developed to introduce greater flexibility in the management of multiple partitions than the Master Boot Record ("MBR") approach which only allows four partition table entries comprising primary and extended partition boot records.

The content of the BCD File may be managed with a command line tool, "bcdedit.exe", using the Registry Editor, using Windows Management Instrumentation or using a third party tool such as EasyBCD. "bcdedit.exe" can be found in the "\windows\system32" directory on the Windows 7 boot drive.

The BCD File may contain –

  1. the menu entries that are presented by the Windows Boot Manager on boot;
  2. options to boot Windows by invoking "winload.exe", the Windows operating system boot loader;
  3. options to boot a previous version of Windows by invoking the original Windows NT boot loader, "NTLDR";
  4. options to load and execute a system deployment image ("SDI") in RAM; and
  5. options to load and execute a volume boot record;

System deployment image: boot.sdi

The system deployment image ("SDI") file format is a Windows-specific file format used to store an arbitrary disk image comprising binary large objects ("BLOBs") as follows –

  1. the boot BLOB, containing the bootstrap code;
  2. the operating system loader BLOB, which is to be launched by the boot BLOB;
  3. the boot runtime BLOB;

Alternatively, an SDI file may contain a disk BLOB, which is a hard disk image starting with an MBR.

Windows image: winRE.wim

The windows image ("WIM") file format is a file-based image format which comprises a set of files and associated file system metadata, such as attributes and ownership.

A file in "WIM" format comprises –

  1. a header, which defines the content of the .wim file and specifies the offset, or pointer for key resources such as the metadata resource, the lookup table and the XML data together with various .wim file attributes such as the version of the file format used, the size of the file and the compression method applied.
  2. one or more images.

Each image comprises –

  1. one or more file resources;
  2. a metadata resource which contains information about the files recorded in the image including the directory structure, and file attributes;
  3. a lookup table specifying the offset or pointer of each file resource in the image;
  4. XML data providing additional variable length information relating to the image; and
  5. an integrity table which contains security hash / checksum information for the image.

Split WIMs: cdrivebackup.swm, cdrivebackup2.swm and cdrivebackup3.swm

A file with the extension .swm is a WIM file that has been split into one or more files to comply with any technical limitations associated with the media upon which the files are to be recorded. For example, for recording on CD-ROM disc (700MB), or on FAT32 volumes (2GB).

The Windows 7 boot process in summary

On booting, a computer with a regular installation of Windows 7 operating on a computer system that uses standard IBM PC compatible firmware will –

  1. load and execute the MBR;
  2. identify the active partition;
  3. load and execute the VBR;
  4. load and execute "bootmgr";
  5. optionally, "bootmgr" will display a menu of boot options; and
  6. on selection of the relevant boot option or in default of any such selection, "bootmgr" will operate in accordance with the instructions recorded in the BCD file.

Problem solving methodology

Although a systematic methodology was adopted for solving the "unbootable media" problem which comprised the production of a memory key that was able to boot to a rudimentary Windows Pre-installation Environment ("WinPE") or Windows Recovery Environment ("WinRE"), for this purposes of this article I will avoid any unnecessary steps and augment the process with any noteable findings.

Step 1: create bootable USB memory key

  1. boot Lenovo X100e;
  2. insert USB memory key / disk drive
  3. open the "command prompt" application, either by typing "cmd" in the "search programs and files" dialog on the start menu, or by navigating into "All Programs" and "Accessories";
  4. execute "diskpart";
  5. at the "DISKPART>" prompt, type –
    DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt
    -------- ------------- ------- ------- --- ---
    Disk 0 Online XXX GB 0 B
    Disk 1 Online 7xxx MB
  6. identify the USB memory key / disk drive by reference to its capacity in the "size" column;
  7. replacing "N" with the disk number identified in the process above, type –
    DISKPART> select disk N
  8. the following step is irreversible so having satisfied yourself that anything recorded on your memory key may be rendered unrecoverable: to clear the partition information on the disk, type–
    DISKPART> clean
  9. create a new primary partition on the memory key –
    DISKPART> create partition primary
  10. mark the new primary partition on the memory key as an "active" or a bootable partition –
    DISKPART> active
  11. exit the "diskpart" utility –
    DISKPART> exit
  12. format that USB memory key / disk drive –
  13. using the Windows 7 "Computer" function on the Start Menu, or using the by selecting "My Computer" function in Windows Explorer: 
  14. <make selections>


Inspection of the format

WIM - Windows Imaging Format


Windows Automated Installation Kit