I'm following this guide, which advises to run the following command: swapoff /dev/sdaX . I want to make sure I don't overwrite the wrong swap partition (please forgive any wrong terminology; I don't know what I'm doing). So basically, my question is:


Which sda should I run swapoff on?


For instance, since this line: /dev/sda1 472M 112M 336M 25% /boot is included in the output of df -h, should I not use this? Is this "sda1" only for boot?

Here are some outputs of various commands:


sudo fdisk -l /dev/sda
Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2138c9e4

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048    999423    997376   487M 83 Linux
/dev/sda2       1001470 625141759 624140290 297.6G  5 Extended
/dev/sda5       1001472 625141759 624140288 297.6G 83 Linux

df -h

df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                         3.9G     0  3.9G   0% /dev
tmpfs                        787M  9.5M  778M   2% /run
/dev/mapper/ubuntu--vg-root  286G  241G   30G  89% /
tmpfs                        3.9G  109M  3.8G   3% /dev/shm
tmpfs                        5.0M  4.0K  5.0M   1% /run/lock
tmpfs                        3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop2                   237M  237M     0 100% /snap/pycharm-community/64
/dev/loop1                    87M   87M     0 100% /snap/core/4917
/dev/loop3                   142M  142M     0 100% /snap/skype/38
/dev/loop0                    87M   87M     0 100% /snap/core/4650
/dev/loop4                   138M  138M     0 100% /snap/skype/33
/dev/loop7                    87M   87M     0 100% /snap/core/4830
/dev/loop6                   133M  133M     0 100% /snap/skype/41
/dev/loop8                   240M  240M     0 100% /snap/pycharm-community/60
/dev/loop5                   233M  233M     0 100% /snap/pycharm-community/62
/dev/sda1                    472M  112M  336M  25% /boot
tmpfs                        787M   68K  787M   1% /run/user/1000

Any other tips from battle-hardened ArchLinux users are appreciated. I have done installations before where I got completely lost, and it would be great to avoid any issues proactively, thanks


I also came from here, but am unsure the implications that has for my problem

2 Answers 2


To create a ArchLinux instalation without an USB drive you must to create some the /rootpartition in somewhere, in this case in your SWAP partition, cause its not necessary for the system. You'll create the ArchLinux system on this partition as the tutorial says.

When you create the filesystem with Archlinux and finish your installation you have to change the partition(previous SWAP partition) and resync to another partition that you want (like clone a disk) and change the mountpoint on /etc/fstab, this file is responsible to mount the partitions at boot time.

The easiest way to do know what partition is your SWAP partition on, is type


The output this command is something like

sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   499M  0 part 
├─sda2   8:2    0   100M  0 part /boot/EFI
├─sda3   8:3    0    16M  0 part 
├─sda4   8:4    0 150.8G  0 part 
└─sda5   8:5    0 314.4G  0 part /data 

In my computer I don't use a SWAP partition, but with this commando you'll be able to know which partition is your SWAP file on.

Additionally, you can see more information on https://wiki.archlinux.org/index.php/swap there are some information to create/disable SWAP partition, SWAP FILE (it's something interesting to know).

Best regards.


The command swapoff /dev/sdaX is useless because you don't have a swap partition yet. Follow the installation guide to create a swap.

The /dev/sda1 is your boot partition.

The /dev/sda5 contains the Ubuntu installation.

The /dev/sda2 should be partitioned to create the swap and the root partition.

  • /dev/sda2 is a logical partition that contains /dev/sda5, which contains the VG that LVM uses to hold all of Ubuntu's partitions, including the swap partition. Partitioning /dev/sda2 without resizing any of the other things using it will surely result in data loss. The asker can simply use LVM's tools to identify the swap LV and swapon that.
    – Thegs
    Jun 28, 2019 at 20:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .