Recovering Dell Laptop Windows OS using factory image from Linux bootable USB drive

I used Linux booted from a USB drive to restore Dell Windows 7 factory image on Inspiron 1545 when Windows 7 stopped booting and F8 key stopped working. This was done using Linux equivalent of Imagex command and used dell factory.wim file.

Credits goes to - https://www.dell.com/community/Windows-General/Restore-from-dell-recovery-partition-with-Imagex-Solved/td-p/4083636

Software used

1, PuppyLinux BionicPup32 8.0 (Ubuntu Bionic 32 bit) Downloaded as ISO image from their website. It is good to use any other popular distros like Ubuntu.
2, When using PuppyLinux, download Devx package which has GCC compiler for the corresponding PuppyLinux distribution. (http://wikka.puppylinux.com/devx). When using a full fledged distribution, this step may not be necessary.
3, USB pen drive or any flash storage. I used SD memory card because my laptop will not boot from a pendrive.
3, unetbootin-windows-661.exe
4, Wimlib 1.13.1 - downloaded source because a binary distribution is not available for Linux. I used wimlib-1.13.1.tar.gz
5, Another computer with Windows or Linux
6, It is good to have WIFI or LAN with internet access to download files. Otherwise will have to copy Wimlib and other files to the same USB drive.

Steps:

1, Create bootable USB drive. I created it on a SD card in another laptop using Unetboot and PuppyLinux, copied wimlib source and PuppyLinux Devx package to same SD card.
2, In the laptop that needs to be recovered, boot from this USB drive. I had to press F12 while Dell logo is displayed to select option to boot from USB.
3, Once booted into Linux, open a terminal window to execute commands.
4, Run fdisk -l to see hard disk and pendrive partitions. For me the hard disk is on /dev/sda and SD card on /dev/sdb
5, Mount pendrive disk using below commands. NOTE : all commands should be executed as root user.
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb

Only for PuppyLinux to install Devx package - Open file browser, go to /mnt/usb and click on Devx package to install it. Verify gcc is installed by running gcc command.

6, Extract wimlib source files compile and install it.
tar -xf wimlib - source tar

cd wimlib source folder
./configure
make
make install

Verify wimlib is installed by running command wimlib-imagex command

7, From fdisk -l command output, identify hidden Dell partition with factory image, and C Drive (where originally Windows was installed). For me hidden Dell partition is /dev/sda2 which was 14.7 GB and C drive is /dev/sda3.
8, Mount hidden Dell partition
mkdir /mnt/bdrive
mount /dev/sda2 /mnt/bdrive

9, Dell factory image is at /mnt/bdrive/dell/Image/Factory.wim
wimlib-imagex apply /mnt/bdrive/dell/Image/Factory.wim /dev/sda3

This will install factory image to C drive and took around 15 minutes.

Once this is done, reboot system to boot from hard disk.

In case MBR or partition table is corrupted, appropriate tool should be used to fix it.

Comments

Popular posts from this blog

Multi Tenant applications using PostgreSQL Row Level Security

java.util.logging - Bad level value for property: org.openqa.level