Score:0

How can I merge 2 devices to extend my root partition

in flag

My root partition is almost full, and I don't have much space in root device /dev/sda5.

I have another device which has space. The device is /dev/sdb1

I want to merge the devices to use the space available in sdb1

enter image description here

Score:0
in flag

You can merge partitions if they are adjacent, but not without sacrificing the data in one or both of them.

You can't merge devices this way. The closest way would be to use RAID, but you'd have to sacrifice (or copy off and copy back) all the data. And RAID without redundancy is dangerous to the data. (RAID with redundancy is less dangerous.)

However, you can split the data. For instance, you could move /home to the other disk, and either mount the second disk on the first one as /home or symlink it. Alternately, with /home, you could move just a single user and change their home directory location in /etc/passwd

However, the / partition is tricky to split like that. Only some directories are safe to move; if you move the wrong ones, your system may not be able to find its parts to boot. Either way, /etc/fstab would need to be updated as part of the move.

As small as these partitions are, it might be easier to just buy a bigger disk. These are small enough it might be difficult to split.

in flag
An LVM would be a safer option to RAID, as devices could be added/removed on a whim (within reason). That said, it would also suffer from the same challenge of moving the OS
Muhammad Tariq avatar
in flag
I think your suggestion of mounting the `/home` is better to create some space in the root. How can I accomplish this? Is it okay to replace `/mnt/sdb1_partition/` with `/home` in /etc/fstab file ?
user10489 avatar
in flag
If you have data in /home now, you can copy it to /mnt/sdb1_partition/ and rename or delete the contents of /home and then umount that, edit fstab, and then mount /home. It is safe to replace it in fstab, but remember if you don't empty /home before mounting, the data is still there taking up space even if you can't get to it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.