I have windows 7 and backtrack linux on the same system and i am dual booting them. now i want to remove the "windows 7" partition from my disk and use it to expand my linux OS HDD size.

Thanks....

Dani AI

Generated

Short summary for : there are two practical routes — a clean reinstall that uses the whole disk (simpler), or a non‑destructive removal of the Windows partitions and expansion of your existing BackTrack filesystem. is right that reinstalling is often the least painful; below is a focused, safer non‑destructive workflow with concrete checks and commands you can run from a live USB.

First, inspect the disk and boot mode so you don’t accidentally remove the boot area. From a live session run:

sudo lsblk -f
sudo blkid
sudo parted -l
sudo efibootmgr -v    # shows UEFI entries if present

Look for NTFS partitions and for either a small BIOS "system reserved" area (MBR) or an EFI System Partition (FAT32) used by UEFI — do not remove the ESP unless you know Linux has its bootloader there.

Non‑LVM, ext* root: after backing up, delete the Windows/NTFS partition and then expand/move the Linux partition into the free space (this is best done from a live session; moving can take a long time). After the partition table change run:

sudo e2fsck -f /dev/sdaX
sudo resize2fs /dev/sdaX

(choose the correct device; if the FS is XFS you must use xfs_growfs while mounted.)

LVM users: convert the freed partition into a physical volume and add it to your volume group, then extend the logical volume and filesystem:

sudo pvcreate /dev/sdaY
sudo vgextend vg_name /dev/sdaY
sudo lvextend -l +100%FREE /dev/vg_name/lv_name
sudo resize2fs /dev/vg_name/lv_name

If the system won’t boot afterward, chroot from the live USB and reinstall the bootloader:

sudo mount /dev/sdaX /mnt
for d in /dev /dev/pts /proc /sys; do sudo mount --bind $d /mnt$d; done
sudo chroot /mnt
grub-install /dev/sda
update-grub
exit

Always image the disk first (example: sudo dd if=/dev/sda of=/path/to/backup.img bs=4M status=progress) and keep a recovery live USB handy. If any step feels risky, a full reinstall (the quick option mentioned) is the safest way to get one clean, correctly sized system.

The easiest would probably be to reinstall backtrack linux, and merge the partitions as part of the install process. You can always backup the home folder (or others) and any other system files (which you can later resynchronize with rsync, or manually with diff on all the config files). And if you don't want to lose the list of packages that you installed, just get the list with dpkg -l, save that to a file and after the fresh install you just feed that list to apt-get. I did that process with a ubuntu -> kubuntu migration, and it didn't take more than an hour total.

But if you really can't do a fresh install, then it's a bit harder and more time consuming, but possible.

I'm not sure if GParted or other similar partition managers (or fdisk) are able to take the deleted the windows partition(s) and extend the main linux partition with that (assuming the physical layout of the partitions will permit it). If it is possible, then you can just do that.

It is possible that your boot-loader will be confused by this change and no longer be able to boot you linux install (are you dual-booting by chainloading grub with neogrub, or by using grub on the MBR?). So, I recommend that you have a suitable LiveCD ready in case you have to repair the bootloader (and, btw, if you're doing information security stuff, you probably want to use a LiveCD all the time anyways, or a read-only flash drive).

If it isn't possible to merge the Linux partition with the freed space of the deleted windows partition(s), then you just have to create a new partition(s), and reformat it(them). Then, add the entry(ies) to the /etc/fstab file, choosing a mount-point(s) that makes sense. And you're good to go.

Overall, that's what you have to do, it's that simple, removing Windows is just a matter of deleting the partition(s). I'm just not sure how robust the boot-loaders are to drastic changes in the partition table, but reinstalling a boot-loader from a LiveCD isn't as hard as it sounds.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.