Friday, June 1, 2018

Linux - delete Windows 10 and unnecessary partitions from disk


I need advice on deleting unnecessary partitions and Windows 10 from the hard disk and only keep Linux working.
There is one 500 GB hard disk in my computer; on this disk I have Windows 10 which was installed first, and a Trisquel GNU/Linux.
I was installing Trisquel to this disk on another computer.
To boot Trisquel, I keep my BIOS boot mode set to Legacy (CSM); to boot Windows I switch it to UEFI.
Now I want to get rid of Windows and delete the unnecessary partitions.
This is the output of sudo parted -l:

Model: ATA ST500DM002-1BD14 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 1050MB 1049MB ntfs hidden, diag
2 1050MB 1322MB 273MB fat32 EFI system partition boot
3 1322MB 1456MB 134MB Microsoft reserved partition msftres
4 1456MB 389GB 388GB ntfs Basic data partition msftdata
6 389GB 409GB 20,0GB ext4
7 409GB 412GB 2406MB linux-swap(v1)
8 412GB 486GB 74,1GB xfs
5 486GB 500GB 14,1GB ntfs hidden, diag

My question is: which of these partitions are safe to delete and be able to properly boot Trisquel?
I'd like to keep only partitions: 4, 6, 7 and 8 + of course GRUB/boot partition, but I don't know which is it (I know partition 2 has a boot flag but I don't know if it's the only partition required to start Linux).
From partition 4 (388 GB NTFS) I'd like to delete Windows folders manually and leave my data on it.

EDIT: I've added the
Output of cat /etc/fstab


Answer



You can delete all the partitions but the ones you explicitly mentioned to want to keep (assuming you don't have any data you want to keep stored on them, of course and please make very sure that there really isn't any data you still need on the partitions you delete as it may very well be impossible to restore it afterwards) because they are only necessary for Windows or UEFI. If you get rid of Windows, you don't need UEFI any more.


None of the partitions seem to be mounted anywhere but just to be sure check whether the file /etc/fstab contains anything other than the instructions to mount partitions 6 to / and partition 7 as swap. I also commented this and can tell you whether that's the case if you can't tell it yourself.


After taking a look at the contents of /etc/fstab you posted: Your system requires these 3 partitions to run: 6, 7, 8. Since you want to keep partition 4, you can delete the partitions 1, 2, 3, and 5. If you want to use UEFI in the future, don't delete partition 2 because this would require recreating it when you want to boot a system via UEFI. If you want to go all BIOS, you can delete it.


After deleting partitions 1, 3, 5, and maybe 2, your Linux system will still boot. You also can move and resize them the way you like them. But once you're done, you should boot into your Linux installation and execute this command:


sudo update-grub

This will read in the systems your computer can boot, again.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...