0

I am running endeavourOS and I want to create a swap partition, I have already installed the OS but did not choose swap when I installed the OS.

I tried to shrink a partition to make it into a swap partition. but the new partition did not show up on lsblk, following Arch Wiki but I don't know what to put in mkswap /dev/sdxy (i mean xy, as I am expected to replace it with swap partition).

After running sudo fdisk -l /dev/sda

Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: HGST HTS721010A9
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 4C19DF52-AD65-4D4A-84CD-9B5A23F52B57

Device Start End Sectors Size Type /dev/sda1 2048 534527 532480 260M EFI System /dev/sda2 534528 567295 32768 16M Microsoft reser /dev/sda3 567296 1478139903 1477572608 704.6G Microsoft basic /dev/sda4 1510909952 1920509951 409600000 195.3G Linux filesyste /dev/sda5 1920509952 1922516991 2007040 980M Windows recover /dev/sda6 1922516992 1953511423 30994432 14.8G Microsoft basic

sahil
  • 23

1 Answers1

0

sda3 and sda4 are not contiguous so I am guessing you shrunk sda3 using Windows disk management. That would leave unformatted space between sda3 and sda4. That action alone will not create a partition for lsblk to list.

If you use a tool like GParted all will become obvious. You just need to create a swap partition with GParted in the space between sda3 and sda4 or you can do it with a command line tool like parted.

I usually recommend making a backup of any data you cannot afford to lose before starting this kind of operation.

Good luck

PonJar
  • 371