0

I'd like to use a partition swapping instead of a swapfile, so I can share it along operating systems (I dual boot). How do I do this? I currently have a swapfile, so I thought I would replace of the following line of /etc/fstab

/swapfile none swap sw 0 0

with

UUID=cf41cf78-6acb-4c14-80e5-7c791ef832c9 none swap sw 0 0

which I got from blkid. blkid also says my partition has TYPE="swap"

However, my laptop would not boot up after that anymore, and I had to reinstall Ubuntu. What am I doing wrong?

  • If you want to use a partition instead of the now default swapfile and decided to reinstall then you should've defined that partition during the installation by selecting "something else" and manually defining all the required partitions. – ChanganAuto Jul 01 '22 at 14:00
  • Should work as such provided the partition you are referring to indeed is a valid swap partition. – vanadium Jul 01 '22 at 14:31
  • @vanadium how can I verify it is indeed a valid swap partition? – sadkfdsfjklsdfjklds Jul 01 '22 at 14:56
  • Shouldn't hurt to run mkswap on the partition if it's not in use. – ubfan1 Jul 01 '22 at 15:39
  • This system is dual boot; and I share a swap partition between the two systems, but you likely didn't need to re-install Ubuntu; just boot live media & correct error(s) you'd made. Don't forget both OSes will need to be in sync with each other; neither be suspended-to-disk when you boot the other (as it'll corrupt the others suspend) & if encryption is used it's more difficult (key is they must be in sync). I use it as this box only has small drive thus I share; with a swapfile ready to be enabled for when I need more than swap-partition allows for. – guiverc Jul 01 '22 at 22:49
  • You've provided no OS/release details for the systems you're asking about... It matters less if you're not using encryption; but the difference in the software stacks may matter. – guiverc Jul 01 '22 at 23:00

0 Answers0