0

I recently had a problem and had to reinstall my Ubuntu Gnome (which is working fine now).

I booted from the live cd and used the option Erase and reinstall.

The thing is: I had manually created a swap partition on my HDD during my first installation and I think the Erase and reinstall process created a new one on my SSD (I have root on SSD and \home on HDD).

I checked with GParted and my swap partition on HDD has the Swap on button available (I guess this means it is not being used) and the one on SSD has the button swap off available (I guess this means it is the one that it is being used).

As I've read that it is dangerous to have swap partition on SSD I want to erase it and use the one that I have on HDD.

Does the following procedure work and can be considered safe:

1) Boot into live cd

2) Launch Gparted

3) Swap off the swap partition on SSD

4) Erase the swap partition on SSD

5) swap on the swap partition on HDD

?

Do I somehow need to tell Ubuntu to use the one on HDD after this process?

Do I need to edit the /etc/fstab file after this?

Could you perhaps guide me through this process?

Thanks

0

To remove the swap you need to live boot your system using a LiveCD or USB. As root runthe following command to ensure swap is disabled: swapoff /dev/<driveNameOfSwapToRemove>

Now open your fstab file as root located at /etc/fstab. It will look something like this:

# <device>             <dir>         <type>    <options>             <dump> <fsck>
/dev/sda1              /             ext4      defaults,noatime      0      1
/dev/sda2              none          swap      defaults              0      0
/dev/sda3              /home         ext4      defaults,noatime      0      2

Now remove the line that points to your swap (eg /dev/sda2) and then save and close the file.

If the other swapspace is not listed under your fstab file simply run swapon <swapdrive name> to enable it immediately. To enable it on boot you need to add it to your fstab using the same format as above.

  • Does that erase the swap partition? I'm mean I don't have to use GParted in any way? – Francisco Aug 21 '17 at 20:31
  • No, that does not remove the physical partition, simply deactivates it. Resizing partitions with data on them is risky, unless you really need that extra space, if not then you would not need Gparted here. – Kris Stadler Aug 21 '17 at 20:36
  • But I would erase it and I would not touch the root one..so what can be the problem? – Francisco Aug 21 '17 at 20:38
  • It's not impossible to remove that partition, it's just risky to remove it when other data and partitions are present on the same drive. Gparted will be able to help you with the resizing, but remember that the chance the process could corrupt some of the data on the drive in the process is high if not done correctly. – Kris Stadler Aug 21 '17 at 20:49
  • Cheers mate..you're helpful – Francisco Aug 21 '17 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.