mirror of
https://github.com/007revad/Synology_Recover_Data.git
synced 2026-08-01 18:11:55 +02:00
v2.0.18
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
v2.0.18
|
||||||
|
- Updated so powershell script also installs syno_recover_data.sh on USB boot drive for you.
|
||||||
|
- Only works on computers with AMD64 (x86_64) CPUs.
|
||||||
|
- The required older kernel is not available for ARM64 (aarch64).
|
||||||
|
- Bug fix for RAID 5, 6, 10 and SHR with more than 2 drives.
|
||||||
|
- Now includes a Synology btrfs compatible kernel (4.15.0-108).
|
||||||
|
|
||||||
v2.0.17
|
v2.0.17
|
||||||
- Only works on computers with AMD64 (x86_64) CPUs.
|
- Only works on computers with AMD64 (x86_64) CPUs.
|
||||||
- The required older kernel is not available for ARM64 (aarch64).
|
- The required older kernel is not available for ARM64 (aarch64).
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ At the moment the script only supports mounting 1 volume at a time. You'd need t
|
|||||||
- Right-click the downloaded Synology_Recover_Data.zip, select Properties, check Unblock, click OK, then extract.
|
- Right-click the downloaded Synology_Recover_Data.zip, select Properties, check Unblock, click OK, then extract.
|
||||||
- Right-click on **patch_ubuntu_usb.ps1** and select **Run with PowerShell**, or run from a PowerShell window with .\patch_ubuntu_usb.ps1.
|
- Right-click on **patch_ubuntu_usb.ps1** and select **Run with PowerShell**, or run from a PowerShell window with .\patch_ubuntu_usb.ps1.
|
||||||
- Enter your USB drive's drive letter when asked.
|
- Enter your USB drive's drive letter when asked.
|
||||||
|
<p align="left"> <img src="/images/powershell.png"></p>
|
||||||
8. You can now reboot the computer, [enter the BIOS](https://www.tomshardware.com/reviews/bios-keys-to-access-your-firmware,5732.html) and set it to boot from the USB drive, and boot into Ubuntu.
|
8. You can now reboot the computer, [enter the BIOS](https://www.tomshardware.com/reviews/bios-keys-to-access-your-firmware,5732.html) and set it to boot from the USB drive, and boot into Ubuntu.
|
||||||
- I highly recommend unplugging the SATA cables from the PC's drives, while the computer is turned off, so you don't accidentally install Ubuntu on them.
|
- I highly recommend unplugging the SATA cables from the PC's drives, while the computer is turned off, so you don't accidentally install Ubuntu on them.
|
||||||
9. **IMPORTANT!** When you see the GRUB boot menu select "**Try Ubuntu (kernel 4.15.0-108)**".
|
9. **IMPORTANT!** When you see the GRUB boot menu select "**Try Ubuntu (kernel 4.15.0-108)**".
|
||||||
@@ -90,7 +91,10 @@ After booting into Ubuntu:
|
|||||||
1. Plug in the USB drive containing the *.rkey file or files, or browse to the network share where your *.rkey file or files are located.
|
1. Plug in the USB drive containing the *.rkey file or files, or browse to the network share where your *.rkey file or files are located.
|
||||||
3. Copy the *.rkey file or files to Home.
|
3. Copy the *.rkey file or files to Home.
|
||||||
|
|
||||||
### Setup in Ubuntu
|
### Setup in Ubuntu - only needed for v2.0.16 and older
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click here to see list</summary>
|
||||||
|
|
||||||
1. Open Firefox from the tool bar and go to [https://github.com/007revad/Synology_Recover_Data](https://github.com/007revad/Synology_Recover_Data) or https://tinyurl.com/synorecover and download the latest release's [zip file](https://github.com/007revad/Synology_Recover_Data/releases).
|
1. Open Firefox from the tool bar and go to [https://github.com/007revad/Synology_Recover_Data](https://github.com/007revad/Synology_Recover_Data) or https://tinyurl.com/synorecover and download the latest release's [zip file](https://github.com/007revad/Synology_Recover_Data/releases).
|
||||||
- Or download the latest script directly https://github.com/007revad/Synology_Recover_Data/releases/latest/download/Synology_Recover_Data.zip
|
- Or download the latest script directly https://github.com/007revad/Synology_Recover_Data/releases/latest/download/Synology_Recover_Data.zip
|
||||||
@@ -106,13 +110,18 @@ After booting into Ubuntu:
|
|||||||
7. Right-click on Terminal and click on Save to favorites.
|
7. Right-click on Terminal and click on Save to favorites.
|
||||||
8. Press Esc twice to return to the desktop.
|
8. Press Esc twice to return to the desktop.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
### Running the script
|
### Running the script
|
||||||
|
|
||||||
1. Open Terminal from the tool bar.
|
1. Open Terminal from the tool bar.
|
||||||
2. Type `sudo -i /home/ubuntu/syno_recover_data.sh` and press enter.
|
2. Type `sudo bash /cdrom/syno_recover_data.sh` and press enter.
|
||||||
<p align="left"> <img src="/images/run-script.png"></p>
|
<p align="left"> <img src="/images/run-script-new.png"></p>
|
||||||
|
|
||||||
|
**Note:** For v2.0.16 and older:
|
||||||
|
Type `sudo -i /home/syno_recover_data.sh` and press enter.
|
||||||
|
|
||||||
|
|
||||||
### Accessing your data
|
### Accessing your data
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
+30
-7
@@ -24,9 +24,10 @@ Write-Host "Synology Recover Data - Ubuntu USB kernel patch" -ForegroundColor Cy
|
|||||||
Write-Host "================================================" -ForegroundColor Cyan
|
Write-Host "================================================" -ForegroundColor Cyan
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
|
|
||||||
# Find vmlinuz in the same directory as this script
|
# Find files in the same directory as this script
|
||||||
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||||
$kernelSrc = Join-Path $ScriptDir $KernelFile
|
$kernelSrc = Join-Path $ScriptDir $KernelFile
|
||||||
|
$recoverSrc = Join-Path $ScriptDir "syno_recover_data.sh"
|
||||||
|
|
||||||
if (-not (Test-Path $kernelSrc)) {
|
if (-not (Test-Path $kernelSrc)) {
|
||||||
Write-Host "ERROR: $KernelFile not found in script directory." -ForegroundColor Red
|
Write-Host "ERROR: $KernelFile not found in script directory." -ForegroundColor Red
|
||||||
@@ -36,12 +37,20 @@ if (-not (Test-Path $kernelSrc)) {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path $recoverSrc)) {
|
||||||
|
Write-Host "ERROR: syno_recover_data.sh not found in script directory." -ForegroundColor Red
|
||||||
|
Write-Host "Make sure syno_recover_data.sh is in the same folder as this script." -ForegroundColor Red
|
||||||
|
Write-Host ""
|
||||||
|
Read-Host "Press Enter to exit"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# List removable drives to help user identify the correct one
|
# List removable drives to help user identify the correct one
|
||||||
Write-Host "Removable drives currently available:" -ForegroundColor Cyan
|
Write-Host "Removable drives currently available:" -ForegroundColor Cyan
|
||||||
$removableDrives = Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DriveType -eq 2 }
|
$removableDrives = Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DriveType -eq 2 }
|
||||||
if ($removableDrives) {
|
if ($removableDrives) {
|
||||||
foreach ($drive in $removableDrives) {
|
foreach ($drive in $removableDrives) {
|
||||||
$size = [math]::Round($drive.Size / 1GB, 0)
|
$size = [math]::Round($drive.Size / 1GB, 0)
|
||||||
$label = if ($drive.VolumeName) { $drive.VolumeName } else { "No label" }
|
$label = if ($drive.VolumeName) { $drive.VolumeName } else { "No label" }
|
||||||
Write-Host " $($drive.DeviceID) - $label ($size GB)" -ForegroundColor White
|
Write-Host " $($drive.DeviceID) - $label ($size GB)" -ForegroundColor White
|
||||||
}
|
}
|
||||||
@@ -52,8 +61,8 @@ Write-Host ""
|
|||||||
|
|
||||||
# Prompt for drive letter
|
# Prompt for drive letter
|
||||||
Write-Host "Enter the drive letter of your Ubuntu 19.10 USB drive (e.g. G): " -ForegroundColor Cyan -NoNewline
|
Write-Host "Enter the drive letter of your Ubuntu 19.10 USB drive (e.g. G): " -ForegroundColor Cyan -NoNewline
|
||||||
$letter = Read-Host
|
$letter = Read-Host
|
||||||
$letter = $letter.Trim().TrimEnd(':').ToUpper()
|
$letter = $letter.Trim().TrimEnd(':').ToUpper()
|
||||||
$UsbDrive = "${letter}:"
|
$UsbDrive = "${letter}:"
|
||||||
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
@@ -120,6 +129,20 @@ if ($fileSize -lt 1MB) {
|
|||||||
}
|
}
|
||||||
Write-Host "Copied $KernelFile successfully ($([math]::Round($fileSize / 1MB, 1)) MB)." -ForegroundColor Green
|
Write-Host "Copied $KernelFile successfully ($([math]::Round($fileSize / 1MB, 1)) MB)." -ForegroundColor Green
|
||||||
|
|
||||||
|
# Copy syno_recover_data.sh to USB drive root
|
||||||
|
$recoverDest = "$UsbDrive\syno_recover_data.sh"
|
||||||
|
Write-Host "Copying syno_recover_data.sh to USB drive..." -ForegroundColor Cyan
|
||||||
|
try {
|
||||||
|
Copy-Item $recoverSrc $recoverDest -Force
|
||||||
|
} catch {
|
||||||
|
Write-Host "ERROR: Failed to copy syno_recover_data.sh to USB drive." -ForegroundColor Red
|
||||||
|
Write-Host $_.Exception.Message -ForegroundColor Red
|
||||||
|
Write-Host ""
|
||||||
|
Read-Host "Press Enter to exit"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
Write-Host "Copied syno_recover_data.sh successfully." -ForegroundColor Green
|
||||||
|
|
||||||
# Patch grub.cfg - insert new menu entry after "set timeout=X" line
|
# Patch grub.cfg - insert new menu entry after "set timeout=X" line
|
||||||
Write-Host "Patching grub.cfg..." -ForegroundColor Cyan
|
Write-Host "Patching grub.cfg..." -ForegroundColor Cyan
|
||||||
$newContent = $grubContent -replace "(set timeout=\d+\r?\n)", "`$1$NewMenuEntry"
|
$newContent = $grubContent -replace "(set timeout=\d+\r?\n)", "`$1$NewMenuEntry"
|
||||||
@@ -143,6 +166,6 @@ Write-Host " 1. Safely eject the USB drive" -ForegroundColor White
|
|||||||
Write-Host " 2. Connect your Synology drives to your PC" -ForegroundColor White
|
Write-Host " 2. Connect your Synology drives to your PC" -ForegroundColor White
|
||||||
Write-Host " 3. Boot from the USB drive" -ForegroundColor White
|
Write-Host " 3. Boot from the USB drive" -ForegroundColor White
|
||||||
Write-Host " 4. Select 'Try Ubuntu (kernel 4.15.0-108)' from the boot menu" -ForegroundColor White
|
Write-Host " 4. Select 'Try Ubuntu (kernel 4.15.0-108)' from the boot menu" -ForegroundColor White
|
||||||
Write-Host " 5. Run the syno_recover_data.sh script" -ForegroundColor White
|
Write-Host " 5. Open a terminal and run: sudo bash /cdrom/syno_recover_data.sh" -ForegroundColor White
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Read-Host "Press Enter to exit"
|
Read-Host "Press Enter to exit"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
MDADM_BINARY="${SCRIPT_DIR}/mdadm-3.4"
|
MDADM_BINARY="${SCRIPT_DIR}/mdadm-3.4"
|
||||||
CRYPTSETUP_BINARY="${SCRIPT_DIR}/cryptsetup-static"
|
CRYPTSETUP_BINARY="${SCRIPT_DIR}/cryptsetup-static"
|
||||||
|
|
||||||
scriptver="v2.0.17"
|
scriptver="v2.0.18"
|
||||||
script=Synology_Recover_Data
|
script=Synology_Recover_Data
|
||||||
repo="007revad/Synology_Recover_Data"
|
repo="007revad/Synology_Recover_Data"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user