Skip to content

Instantly share code, notes, and snippets.

@kpion
Last active January 28, 2019 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpion/595b5e9c2951f2397770a03ffa4c86d4 to your computer and use it in GitHub Desktop.
Save kpion/595b5e9c2951f2397770a03ffa4c86d4 to your computer and use it in GitHub Desktop.
swap-thing

swap thing

result of using gui KDE Partition manager:

Job: Create file system ‘linuxswap’ on partition ‘/dev/sda2’ 
Command: mkswap /dev/sda2 
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
no label, UUID=90a5be52-fca4-48ed-9bc0-18578ee6fb2f 
Create file system ‘linuxswap’ on partition ‘/dev/sda2’: Success

Job: Set the file system label on partition ‘/dev/sda2’ to "swap2" 
Command: mkswap -L swap2 /dev/sda2 
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
LABEL=swap2, UUID=fc6b9135-44fc-41c7-98a7-e3fa392fc000 
Set the file system label on partition ‘/dev/sda2’ to "swap2": Success

result of sudo lsblk --fs

[0] % sudo lsblk --fs
NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
sda                                                         
├─sda1 ext4   datadisk afc78c30-6f9f-40fd-8486-542f63cdd640 /mnt/datadisk
└─sda2 swap   swap2    fc6b9135-44fc-41c7-98a7-e3fa392fc000 
sdb                                                         
├─sdb1 ext4            3bb31bc0-37db-49f5-bf75-f28e3e3973c6 /
├─sdb2                                                      
└─sdb5 swap            4ea7cb51-43ef-4880-aee8-c1597b1a68de [SWAP]

Final result

**modified /etc/fstab file: **

UUID=4ea7cb51-43ef-4880-aee8-c1597b1a68de none swap sw,pri=2 0 0
UUID=fc6b9135-44fc-41c7-98a7-e3fa392fc000 none swap sw,pri=2 0 0

Same priority (2) to make swap spread the requests between the two devices. Swap write / read speed increased from about 60 MB/s to about 120 MB/s improving the system overall performance in case of out of ram situations (which happens a few times a day).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment