2

My system has the option to boot up into three different OS's.

  • Windows 8
  • Linux PearOS 7
  • Linux Backtrack R5

The Windows 8 is installed on my C: drive and I'm perfectly content with that. Linux PearOS 7 is installed on my D: drive along with Linux Backtrack R5.

My D: drive in addition to holding my two Linux partitions also contains several hundred gigabytes of data that is not backed up, or stored anywhere else. I would like to uninstall my Linux PearOS 7 OS to retrieve the several gigabytes taken by it, (20 GB I think)

Is there any way that I can successfully keep my Linux Backtrack R5, Windows 8, and the data on my D: drive intact while removing the installed Linux PearOS 7 OS from the D: drive without having the removal touch any data on the D: drive.

Edit: My diskpart results: enter image description here

-Thanks in advance.

  • One typo and everything is gone :-) Also it might help to answer if you could show us your exact partition layout, all partitions from all disks. – Sampo Sarrala Jun 2 '13 at 19:26
  • Uhm, I'd have to boot into a gparted disk and get a screenshot? Windows doesn't have the exact layouts (ext partitions) in the disk manager? – Zain Patel Jun 2 '13 at 19:38
  • At cmd, diskpart with command list volume might give just enough information, can't try it out just now... – Sampo Sarrala Jun 2 '13 at 19:51
  • Updated it, with a list volume and a list partition. – Zain Patel Jun 2 '13 at 20:20
2

...that (diskpart output) does not help much but at least you know that

Partition 1 = Data you want keep
Partition 2 = Windows/Boot/Bitlocker
Partition 3 = Windows
Extended    = Partition table for logical partitions
All logical = Linux stuff

You should be able to identify and remove PearOS partitions from Backtrack by using some GUI partitioning tool or by taking a look at /etc/fstab.

To remove or to keep:

You want to keep following partitions:

  • All primary partitions.
  • Extended partition.
  • Partitions used by Backtrack.
  • Boot partition.

You want to remove partitions that:

  • Are not found from above list (partitions you want keep).
  • Are not found from Backtrack /etc/fstab.
  • Are not marked as boot partition.

Before you remove anything it would be wise to backup MBR and Extended partition:

Make sure that your hard disk device node is /dev/sda, if not then adjust following command to point to your hdd device node.

# From linux terminal, backup master boot record
dd if=/dev/sda of=/path/for/mbr_backup.img bs=512 count=1

Make sure that extended partition device node is /dev/sda4, if not then adjust following sfdisk command to point to your extended partition.

# From linux terminal, backup extended partition
sfdisk -d /dev/sda4 > /path/for/extended_backup.sfdiskdump

If you have backed up your MBR and extended partition then you can restore all your partitions even after deleting them. Data is not deleted when you remove partition, only partition table is changed to indicate that there is free space to use.
However, if you create new partition with new filesystem in place of removed partition then data is gone (at least partially).

Finally, partitions removed. Take free space to use:

After you have successfully removed those partitions you should be able to resize your data partition so that it will use all space freed by removing PearOS.

  • +1 - This is exactly what I needed, also, very detailed and well-formatted, clear answer. Thank you. – Zain Patel Jun 2 '13 at 21:37
  • I just have to re-thank you for this, I was messing around with my disk order, and I messed something up big time - I must have had 130 GB of crucial data lost. Thankfully, I had backed up my MBR and data using the "dd" trick you showed me, I've successfully recovered all my data. :D – Zain Patel Jun 8 '13 at 23:12
  • @ChickenP great to hear that you've managed to restore it, there's another question (and answer) about data recovery in worst case scenario: superuser.com/a/433785/132604, just in case... – Sampo Sarrala Jun 8 '13 at 23:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.