Re: Can/should I delete /tmp partition?
Hi,
On Sun, Aug 10, 2025 at 08:57:09AM -0400, Default User wrote:
> My system has 8 Gb of physical memory.
>
> On a 256 Gb SSD, I have:
>
> nvme0n1 259:0 0 238.5G 0 disk
> ├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
> ├─nvme0n1p2 259:2 0 23.3G 0 part /
> ├─nvme0n1p3 259:3 0 9.3G 0 part /var
> ├─nvme0n1p4 259:4 0 977M 0 part [SWAP]
> ├─nvme0n1p5 259:5 0 1.9G 0 part
> └─nvme0n1p6 259:6 0 202.6G 0 part /home
Oh dear, insert my usual comment about volume management being a much
better idea than multiple partitions since needs inevitably change and
you don't want to end up with inconvenient sized partitions in the
middle. Such as here where you now have unwanted space (nvme0n1p5, 1.9G)
in between partitions used for /var and /home.
> Can I just:
> 1) shut down the system
> 2) boot from a Debian-Live usb drive
> 3) delete the nvme0n1p5 partition
> 4) "grow" nvme0n1p4 (the swap partition)
> using the space freed up by deleting
> nvme0n1p5
> 5) re-boot into the system
Basically yes but in this case you don't need to shut anything down. You
can do it all while the system is running because the only storage you
will be messing with that is in use is the swap, which you can turn off
and on again.
1. Use favourite partitioning tool to delete unused nvme0n1p5
2, Use partitioning tool to grow nvme0n1p4 as big as it can go. Safe to
do while it's in use since you're just extending the end of it
In parted I think that would be:
resizepart 4 100%
3. Make kernel re-read partition table to see new size of nvme0n1p4
partprobe /dev/nvme0n1
(partprobe is in the parted package)
3. swapoff -a # turn off all swap
4. mkswap /dev/nvme0n1p4 # make new swap on bigger partition
5. Alter /etc/fstab to reference new swap properly as uuid will have
changed
6. swapon -a
You could also just not alter partitions at all and just mkswap on
/dev/nvme0n1p5 as having two smaller swap partitions instead of one
larger one makes no real difference.
Personally I wouldn't do any of this though because it's unlikely that
you will store enough in /tmp to start going into swap. That does then
leave the space unused which is a bit of a shame. Tricky to avoid when
the partitions are how they are. Volume management, it's really handy!
Thanks,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
Reply to: