triz-docs/docs/database-operations/dead-pc-recovery/windows-dead.md
Othmane Ataallah 1a461e1847
All checks were successful
Deploy triz-docs to civital server / build-and-deploy (push) Successful in 1h8m32s
add dead-pc-recovery
2026-04-29 13:11:22 +01:00

102 lines
3.1 KiB
Markdown

---
sidebar_position: 3
title: "Part B — Windows Does Not Boot"
---
# Part B — Windows Does Not Boot (Linux Live USB)
---
If the client's PC will not boot into Windows, you will use a Linux live environment to access the hard drive and copy the database files.
---
## B1 — Boot from the Linux Live USB
1. Insert your bootable Ubuntu USB into the dead PC.
2. Power on the PC and enter the **Boot Menu** (usually `F8`, `F11`, or `F12` — varies by manufacturer).
3. Select your USB drive from the boot menu.
4. When Ubuntu loads, choose **"Try Ubuntu"** (do not install).
---
## B2 — Mount the Windows Drive
Ubuntu may mount the Windows drive automatically. If not:
1. Open the **Files** application (file manager). The Windows drive should appear in the left sidebar — click it to mount it.
2. If it doesn't appear, open a **Terminal** and run:
```bash
# List all available drives and partitions
sudo fdisk -l
```
Look for a partition of type `NTFS` with the size matching the client's main drive (e.g., `/dev/sda3`). Then mount it:
```bash
sudo mkdir -p /mnt/windows
sudo mount -t ntfs-3g /dev/sda3 /mnt/windows
```
Replace `/dev/sda3` with the correct partition name from `fdisk -l`.
3. Verify the drive is mounted:
```bash
ls /mnt/windows
```
You should see the familiar Windows folders: `Users`, `Program Files`, `Windows`, etc.
---
## B3 — Mount the USB Drive
1. Plug in your USB drive. Ubuntu will mount it automatically under `/media/ubuntu/`.
2. Find the exact mount point:
```bash
ls /media/ubuntu/
```
Note the folder name (it will be the USB drive label, e.g., `SUPPORT_USB`). Your full USB path will be something like `/media/ubuntu/SUPPORT_USB`.
---
## B4 — SQL Server: Copy Files from the Dead Drive
Navigate to the SQL Server data directory and copy the files:
```bash
# Adjust the MSSQL version folder (MSSQL14=2017, MSSQL15=2019, MSSQL16=2022)
ls "/mnt/windows/Program Files/Microsoft SQL Server/MSSQL15.MSSQLSERVER/MSSQL/DATA/"
```
You will see all `.mdf`, `.ndf`, and `.ldf` files listed. Copy the client's database files to the USB:
```bash
# Create a folder on the USB for organization
mkdir -p /media/ubuntu/SUPPORT_USB/SQLServer_Recovery
# Copy the target database files (replace ClientDB with the actual name)
sudo cp "/mnt/windows/Program Files/Microsoft SQL Server/MSSQL15.MSSQLSERVER/MSSQL/DATA/ClientDB.mdf" \ /media/ubuntu/SUPPORT_USB/SQLServer_Recovery/
sudo cp "/mnt/windows/Program Files/Microsoft SQL Server/MSSQL15.MSSQLSERVER/MSSQL/DATA/ClientDB_log.ldf" \ /media/ubuntu/SUPPORT_USB/SQLServer_Recovery/
# If a secondary file exists, copy it too
sudo cp "/mnt/windows/Program Files/Microsoft SQL Server/MSSQL15.MSSQLSERVER/MSSQL/DATA/ClientDB.ndf" \ /media/ubuntu/SUPPORT_USB/SQLServer_Recovery/ 2>/dev/null || true
```
---
## B5 — PostgreSQL: Copy Files from the Dead Drive
```bash
# Create a folder on the USB
mkdir -p /media/ubuntu/SUPPORT_USB/PostgreSQL_Recovery
# Copy the entire data directory (adjust version number as needed)
sudo cp -r "/mnt/windows/Program Files/PostgreSQL/15/data" \
/media/ubuntu/SUPPORT_USB/PostgreSQL_Recovery/
```