@heynnema
I have created a 127GB Swap partition instead of Filesystem partition while installing Ubuntu.
How can I transfer the Swap partition space to the filesystem?
@heynnema
I have created a 127GB Swap partition instead of Filesystem partition while installing Ubuntu.
How can I transfer the Swap partition space to the filesystem?
sudo swapoff -a
sudo -H gedit /etc/fstab
Comment out a line that looks similar to this (put a # at the beginning of the line):
UUID=52a6f33f-f94e-4b4d-8b8f-1d31b491c889 none swap sw 0 0
Add this line at the end of the file:
/swapfile none swap sw 0 0
Save the file.
Note: Incorrect use of the dd
command can cause data loss. Suggest copy/paste.
sudo swapoff -a # turn off swap
sudo rm -i /swapfile # remove old /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile # set proper file protections
sudo mkswap /swapfile # init /swapfile
sudo swapon /swapfile # turn on swap
free -h # confirm 16G RAM and 4G swap
Confirm this line in /etc/fstab... and confirm other “swap” lines are commented out...
/swapfile none swap sw 0 0
reboot # reboot and verify operation
Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or lose data.
Keep these things in mind:
always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition
a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor
a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor
if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)
you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window
Do the following...
Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.
gparted