Skip to main content

Merge contiguous partitions /swap, /var, /tmp, /home in a single one on Debian 10 [Resolved]

I did wrong when I installed my first Debian 9 that is now a Debian 10, and chosen a :
/home partition with 180 Gb
/var partition with 10 Gb, too small
/tmp partition with 2 Gb, too small

I am bored with these partitions. I would like to merge them into a single one containing /home, /var and /tmp and have no more stories with limitations.

How do I merge /var, /tmp, /swap, /home partitions (going from /dev/sda5 to /dev/sda8 in my case and are contiguous) ?

Question Credit: Marc
Question Reference
Asked September 21, 2019
Posted Under: Unix Linux
2 Answers

You can do it. Except don't merge swap, and first back-up (at least back up what you can't get back).

  1. Backup
  2. Boot with a live OS. Don't do this on an active system.
  3. Migrate /var and /tmp to / or /home: Copy them over, then change mount table, so that they are not mounted. If you migrate them to /home, then create links to them.
  4. Test
  5. When it is all working.
  6. Delete partitions /var and /tmp
  7. resize /home partition to fill the gap.

credit: ctrl-alt-delor
Answered September 21, 2019
Your Answer