move the swap partition in an Ubuntu system

Asked by dorcap

Good night.
I will simplify a non answered question made for me a few hours ago.
Will the translation of the swap partition, (which is at the other end of the disk), next to the partition of the Ubuntu system to which deserves, damage the Ubuntu system? That is planned with the aim of joining the two parts of the system that now are separated.
Thanks you and be happy,
Francesc

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
dorcap
Solved:
Last query:
Last reply:
Revision history for this message
Wyatt Smith (wyatt-smith) said :
#1

If you move your swap partition there will be a few files which must be manually edited. The two files are

/etc/fstab
/etc/initramfs-tools/conf.d/resume

Your swap partition is specified in these files by UUID in these files, so the first thing you will have to do is determine the UUID of your new swap partition. To do this please open a terminal from the menu Applications-> Accessories-> Terminal and type

sudo blkid

To edit your /etc/fstab file with root permission

sudo gedit /etc/fstab

To edit your /etc/initramfs-tools/conf.d/resume with root permission

sudo gedit /etc/initramfs-tools/conf.d/resume

Edit these files by replacing the old UUID with your new swap UUID

After updating these file you will need to update your initramfs as well. To do this

sudo update-initramfs -u

Please let me know how you make out. Thanks

Revision history for this message
dorcap (dorcap) said :
#2

At this moment, I have only seen /dev/fstab which gives me information of de UUID of the sda1 and and5 partitions (the only existing now), the first is a ext3 formated Ubuntu partition an the second is its swap partition. They are located opposite at the two ends of the disk.
The disk has had also a Debian system sharing the disk with Ubuntu.
/etc/initramfs-tools/conf.d/resume gives me only RESUME=[UUID of the swap area]
blkit gives me information ob ALL THE PARTITIONS I've had in the computer, included some which I've intalled in a pendrive, but NOT EXISTING NOW. As a resolt of the past history of the computer, I've could see information of sda1, sda5, sda6, sda7, sdb5, adb6, sdb8, sdb9, sda3, sda8, sda9, sda10 and sda11. sda5, sda6 and sda8, only with the information TYPE="swap" and no UUID (these were the areas of swap of the different systems I heve installed). All the other named partitions, all formated in ext3, have the corresponding UUIDs.
For make me more craky, the gparted gives me information of the partitions sda1, sda3 sda2 (extended), sda6, sda7, and sda5. It says that sda3 is a boot partition when I have with the grub-install give the boot to the partition 1, and says also that partitions sda6, sda7 and sda5 are part of the sda2 extended partition, when the partition sda5 was the swap partition of the Ubuntu partition (sda1).
Now in the system works the Ubuntu satisfactorily and boots from its partition, not from the partition of Debian, because of the installation of the boot in the sda1 partition, what I've realized with the different type of letter as well.
I excuse me for me for difficulty of the problem but I thing at this moment is better you know all the circumstances of the problem, dues to the experimentation of different sorts of operating systems. I beg your pardon for that.
Be happy,
Francesc

Revision history for this message
Wyatt Smith (wyatt-smith) said :
#3

Please mount all your partition and then open a terminal and type

sudo fdisk -lu
sudo blkid
df

Please tell... the output of these commands.

Thank you

Revision history for this message
dorcap (dorcap) said :
#4

Finally I have formated the disk and have introduced the new informat¡on in the partitions new created.
Thanks,
Francesc