2

I'm planning on uninstalling Windows, which I have currently installed in dual boot with Ubuntu 16.04 LTS. For that I will probably proceed with this method: How do I remove Windows but keep Ubuntu?

The two operating systems are installed on different drives. My question is, after permanently removing Windows and having that drive empty as unallocated space, how can I enlarge the Ubuntu partition to also include that empty drive and be able to use the space of both as one?

Edit: My sudo parted -l output

Zanna
  • 72,312

2 Answers2

5

There are basically four ways to use two physical disks in Ubuntu, but only one of them is likely to be easy to set up, given your likely current configuration. (I'd need to see the output of df or sudo parted -l to be sure, though.) The methods are:

  • Mount multiple filesystems -- This is the method that's likely to be easiest for you to set up. Basically, you create a new partition in the freed space and mount it somewhere convenient (say, /home/{yourusername}/morespace). You'd normally create an entry in /etc/fstab to mount the new partition somewhere convenient, as described here. Although this method is easy to set up, it's likely to be awkward, since the partition sizes might not match what you need, and you'll have to access the new space via whatever mount point you decide to use.
  • Use a filesystem with spanning features -- Some filesystems, such as Btrfs, provide spanning features -- that is, one filesystem can span multiple devices (disks). If you're already using such a filesystem, you can probably reconfigure it to expand across the new volume, although I'm not 100% positive that's possible. See the Btrfs wiki for more on this approach generically. If you're not already using Btrfs, converting to use it will require awkward backup-and-restore operations, or moving your installation to Btrfs on the freed disk and then expanding over to the one you're using now.
  • Use RAID -- In a Redundant Array of Independent Disks (RAID) setup, multiple disks are combined together to act like one. Disks can be combined to improve reliability, speed of access, or both. Unless you're already using RAID, though, converting to a RAID setup is likely to be awkward. Note also that there are two types of software RAID and hardware RAID. (Unless you're using a server, you'd probably need to buy a special controller card to use hardware RAID.) See here for information on one of the software RAID types.
  • Use LVM -- Logical Volume Management (LVM) is another way to combine devices. In LVM, one or more partitions (aka physical volumes) are combined together into one volume group, which is then re-allocated into logical volumes. You store most filesystems on logical volumes, rather than directly on partitions. The advantage is that this gives you greater flexibility to adjusting logical volumes than a traditional partitioning scheme provides. Among other things, you can add new physical volumes and expand logical volumes to fill the new space quite easily -- which of course is exactly what you want to do. Unfortunately, unless you're already using LVM, converting to such a setup is likely to be awkward, requiring backup/restore or installation-moving operations similar to what would be required when converting to Btrfs or RAID. See the Ubuntu wiki page on LVM for an introduction to LVM. There is a tool, called blocks, that's supposed to convert to LVM in place, but I've never used it, and AFAIK it doesn't come with Ubuntu.

A default Ubuntu installation uses ext4fs (which does not support spanning) on a plain partition configuration (that is, no RAID or LVM, unless your computer uses hardware RAID). Thus, chances are only the first of these options will be easy to implement for you; however, I can't be positive of that. If you used an advanced installation option, it might have used software RAID or (more likely) LVM, in which case expanding onto the freed space on your second disk may be relatively easy.

If you're got a default straight partition setup but want more flexibility, my suggestion would be to migrate to LVM. You could either re-install entirely or migrate your existing setup. I tried Googling but I didn't find a good step-by-step procedure for doing such a conversion. (I found a couple that were rather vague on some critical details.) It's certainly possible -- I've done it -- but it is awkward and requires either expertise or good instructions. Overall, backing up your user data and re-installing may be the best way to accomplish the goal. Fortunately, with extra space at hand, the backup part might be easy -- you could create an LVM with a new logical volume for /home in the newly-freed space, copy your existing /home there, and then re-install, telling the installer to use the new /home logical volume, then tweak logical volume sizes as desired.

Rod Smith
  • 45,120
  • 7
  • 66
  • 108
0

I'd recommend keeping Windows installed. It'll be needed to perform tasks that can only be performed in Windows... like BIOS updates, firmware flashes to USB devices, etc.

If you do end up getting rid of Windows, there's no current way in your current configuration to combine the unallocated space spanning two disk drives... unless you use LVM... but this requires a total system reinstall and reconfiguration... on LVM formatted disk drives. (I'd recommend that both drives be of the same type... ie: SATA, or SCSI, etc.)

See https://wiki.ubuntu.com/Lvm for more info about LVM.

Update #1:

Another way to do this is to make /dev/sda for both Windows and Ubuntu operating systems, and /dev/sdb as /home for Ubuntu. If you wanted to easily share files between Windows and Ubuntu, you'd create a small NTFS partition on one of the drives, and also mount it in Ubuntu by editing /etc/fstab.

ps: I see that /dev/sda has a msdos partition table, and /dev/sdb has a gpt partition table. These should probably be the same type... GPT if you've got a UEFI machine. Neither drive is LVM formatted.

heynnema
  • 73,649