2.4.10 rescue

Command: rescue start end

Rescue a lost partition that used to be located approximately between start and end. If such a partition is found, Parted will ask you if you want to create a partition for it. This is useful if you accidentally deleted a partition with parted’s rm command, for example.

Example:

(parted) print
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1000MB  999MB   primary                  boot, lba
 2      1000MB  2300MB  1299MB  primary  ext4            lba
(parted) rm
Partition number? 2
(parted) print
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1000MB  999MB   primary                  boot, lba

OUCH! We deleted our ext4 partition!!! Parted comes to the rescue...

(parted) rescue
Start? 1000
End? 2684
Information: A ext4 primary partition was found at 1000MB ->
2300MB.  Do you want to add it to the partition table?
Yes/No/Cancel? y
(parted) print
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1000MB  999MB   primary                  boot, lba
 2      1000MB  2300MB  1299MB  primary  ext4            lba

It’s back! :)