How to remove windows from dual boot by cloning.
Posted: Tue Feb 19, 2013 5:48 am
I had a dual boot system that ran both Windows 7 and Linux Mint 14. I got to the point that I no longer needed Windows, so I decided to remove the Windows partition and recover the drive space. The problem was that Windows was on the first partition and Linux was on the second partition. I didn't want a second partition, so I decided to move Linux to the first partition, then expand it to use the entire disk. This procedure involves some risk, so it was a little frightening. This tutorial assumes you are using a recent version of Mint, the Grub2 boot loader, and have enough free hard drive space to replicate your existing partition. Please read the entire tutorial before you start. Software varies and I'm doing this from memory, so the options in Gparted may vary, but it should be intuitive and easy to follow along anyway.
Before you do anything, back up your data. I cannot stress this enough. When you remove your windows partition, you will lose everything on that partition, so make sure you save anything you don't want to lose. This method should prevent you from losing anything from your Linux partition, but accidents happen, not all hardware is the same, etc.
There are two methods. The scary method; and the safe method, which is more complicated and takes longer, but ensures you don't lose data.
The scary method:
1. Boot with a live CD or thumb drive using the same version of Linux you are going to clone.
2. Start Gparted. Right click your Windows NTFS partition, choose delete, and apply your changes. Windows is now gone and cannot be recovered.
3. Create a new partition of the same type and same size or larger than the one you want to clone in the new empty space. Apply changes.
4. Right click on the existing Linux partition and choose copy.
5. Right click on the new partition and choose clone (or paste). Apply changes, sit back, and wait. This may take several hours to complete.
6. Delete the old partition and apply changes.
7. Right click on the new partition and select expand.
8. Drag the indicator to cover the empty space. Apply changes. This can take some time, but not as long as the cloning.
9. Note the new mount point of your new partition. (ex.: /dev/sda1/)
10. Open a terminal and enter the command: sudo mount <mount point>
11. Enter the command: sudo gedit <mount point>/boot/grub/grub.cfg
12. Change the existing drive maps to match your new mount point. (example: 'HD0 msdos3' = sda3) Save and close the file.
13. Reboot your computer. Your computer should load to Linux on your new partition.
13. Open a terminal and enter the command: sudo update-grub
14. Enjoy Linux on your new partition.
The safe method:
1. Boot with a live CD or thumb drive using the same version of Linux you are going to clone.
2. Start Gparted. Right click your Windows NTFS partition, choose delete, and apply your changes. Windows is now gone and cannot be recovered.
3. Create a new partition of the same type and same size or larger than the one you want to clone in the empty space. Apply changes.
4. Right click on the existing Linux partition and choose copy.
5. Right click on the new partition and choose clone (or paste). Apply changes, sit back, and wait. This may take several hours to complete.
6. Close Gparted and open a terminal. Enter the command: blkid
7. Note the mount points and UUIDs of all the partitions.
8. Enter the command: tune2fs <mount point of new partition> -U random
9. Wait a few minutes and enter blkid again to ensure the new partition has a different UUID than the original.
10. Reboot your computer without the live CD to ensure the old partition still works properly.
11. Reboot back to the live CD.
12. Open a terminal and enter: tune2fs <mount point of new partition> -U "<UUID of old partition>"
13. Enter the command: tune2fs <mount point of old partition> -U "<UUID of new partition>"
10. Enter the command: sudo mount <mount point of new partition>
11. Enter the command: sudo gedit <mount point of new partition>/boot/grub/grub.cfg
12. Change the drive maps to match the mount point of your new partition. (example: 'HD0 msdos3' = sda3) Save and close the file.
13. Reboot your computer without the live CD. Your computer should load to Linux on your new partition.
14. Reboot to the live CD.
15. Open Gparted, delete the old partition, and apply changes.
16. Right click on the new partition and select expand.
17. Drag the indicator to cover the empty space. Apply changes. This can take some time, but not as long as the cloning.
18. Reboot your computer without the live CD. Your computer should load to Linux on your new partition.
19. Open a terminal and enter the command: sudo update-grub
20. Enjoy Linux on your new partition.
Before you do anything, back up your data. I cannot stress this enough. When you remove your windows partition, you will lose everything on that partition, so make sure you save anything you don't want to lose. This method should prevent you from losing anything from your Linux partition, but accidents happen, not all hardware is the same, etc.
There are two methods. The scary method; and the safe method, which is more complicated and takes longer, but ensures you don't lose data.
The scary method:
1. Boot with a live CD or thumb drive using the same version of Linux you are going to clone.
2. Start Gparted. Right click your Windows NTFS partition, choose delete, and apply your changes. Windows is now gone and cannot be recovered.
3. Create a new partition of the same type and same size or larger than the one you want to clone in the new empty space. Apply changes.
4. Right click on the existing Linux partition and choose copy.
5. Right click on the new partition and choose clone (or paste). Apply changes, sit back, and wait. This may take several hours to complete.
6. Delete the old partition and apply changes.
7. Right click on the new partition and select expand.
8. Drag the indicator to cover the empty space. Apply changes. This can take some time, but not as long as the cloning.
9. Note the new mount point of your new partition. (ex.: /dev/sda1/)
10. Open a terminal and enter the command: sudo mount <mount point>
11. Enter the command: sudo gedit <mount point>/boot/grub/grub.cfg
12. Change the existing drive maps to match your new mount point. (example: 'HD0 msdos3' = sda3) Save and close the file.
13. Reboot your computer. Your computer should load to Linux on your new partition.
13. Open a terminal and enter the command: sudo update-grub
14. Enjoy Linux on your new partition.
The safe method:
1. Boot with a live CD or thumb drive using the same version of Linux you are going to clone.
2. Start Gparted. Right click your Windows NTFS partition, choose delete, and apply your changes. Windows is now gone and cannot be recovered.
3. Create a new partition of the same type and same size or larger than the one you want to clone in the empty space. Apply changes.
4. Right click on the existing Linux partition and choose copy.
5. Right click on the new partition and choose clone (or paste). Apply changes, sit back, and wait. This may take several hours to complete.
6. Close Gparted and open a terminal. Enter the command: blkid
7. Note the mount points and UUIDs of all the partitions.
8. Enter the command: tune2fs <mount point of new partition> -U random
9. Wait a few minutes and enter blkid again to ensure the new partition has a different UUID than the original.
10. Reboot your computer without the live CD to ensure the old partition still works properly.
11. Reboot back to the live CD.
12. Open a terminal and enter: tune2fs <mount point of new partition> -U "<UUID of old partition>"
13. Enter the command: tune2fs <mount point of old partition> -U "<UUID of new partition>"
10. Enter the command: sudo mount <mount point of new partition>
11. Enter the command: sudo gedit <mount point of new partition>/boot/grub/grub.cfg
12. Change the drive maps to match the mount point of your new partition. (example: 'HD0 msdos3' = sda3) Save and close the file.
13. Reboot your computer without the live CD. Your computer should load to Linux on your new partition.
14. Reboot to the live CD.
15. Open Gparted, delete the old partition, and apply changes.
16. Right click on the new partition and select expand.
17. Drag the indicator to cover the empty space. Apply changes. This can take some time, but not as long as the cloning.
18. Reboot your computer without the live CD. Your computer should load to Linux on your new partition.
19. Open a terminal and enter the command: sudo update-grub
20. Enjoy Linux on your new partition.