Question on partition alignment

Hello,

I started to use Manjaro KDE some days ago, and I am truly satisfied with the system, but since I use it on an SSD I am a bit worried:

My fdisk -l output is the following. As you might see the alignment is correct on all of my disks and partitions except my WD 1TB SSD.

The first partition starts at 4096 (which can be divided by 8 or 16). The second one at 618496 (the same goes with that) ad the last one starts at 1808582337 (it cannot be divided without a remainder).

Before I started the installation I just gave my SSD a new GPT partition table by KDE Partition manager (from the LiveCD).

During the installation, I just used the automatic partitioning option.

So... Is it something I should worry about?

Thanks!

Armand

This is the recommended way to check partition alignment
https://wiki.archlinux.org/index.php/Parted#Check_alignment

2 Likes

What on earth do you want a 69.1G swap for on an SSD anyway? The issue is caused by the size of the partition before it. you can specify the end cluster number in advanced settings for KDE partition manager. That value should always be odd to give a divisible number for the start of the next partition.

I tend to use GParted even with KDE when I'm installing. You can download it and run it from system RAM during a Live ISO session as it's a compact enough code base.

image

re-align it from live media or a different OS since you may have several on that machine.

I honestly suggest to investigate systemd-swap :slight_smile:

1 Like

excellent write up about transitioning from swap to zRAM here

Still a swap partition or swapfile is needed for hibernation (if one is to use it), isn't it?

1 Like

Yes if you have only HDD on your system. Otherwise hibernate is pointless even with a slower SATA SSD because with such devices that boot in 6-10 seconds it takes longer to resume from hibernate than it does to start from cold. The more RAM you have, the larger the hibernate image and the longer it takes.

1 Like

This is what ArchWiki says about the hibernation image to be written to the disk. If I understand it somewhat correctly one can even get away with a smaller size for swap than the size of RAM and still be able to hibernate. On this machine I've got 16 GB of RAM and 10 GB swap and it hibernates succesfully:

About swap partition/file size

Even if your swap partition is smaller than RAM, you still have a big chance of hibernating successfully. According to kernel documentation:

/sys/power/image_size controls the size of the image created by the suspend-to-disk mechanism. It can be written a string representing a non-negative integer that will be used as an upper limit of the image size, in bytes. The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number. However, if this turns out to be impossible, it will try to suspend anyway using the smallest image possible. In particular, if "0" is written to this file, the suspend image will be as small as possible. Reading from this file will display the current image size limit, which is set to 2/5 of available RAM by default.

You may either decrease the value of /sys/power/image_size to make the suspend image as small as possible (for small swap partitions), or increase it to possibly speed up the hibernation process. See Systemd#Temporary files to make this change persistent. https://wiki.archlinux.org/index.php/Hibernation#About_swap_partition/file_size

1 Like

Good to know, as always the Arch Wiki is a mine of useful information.

I'll still shutdown rather than hibernate though, I never used hibernate even with HDD. Old habits and all :slight_smile:

I personally use systemd-swap for applications that require a swap of any kind to be present to work properly. I don't want programs writing to the SSD if not necessary.

2 Likes

I've got a combination of swap partition and zRam. I won't probably need to hibernate either since I have an SSD. I might consider getting rid of the swap partition (an old habit that also). I haven't looked into systemd-swap yet, something I should be doing one of these days. Thanks for the replies! I appreciate it.

Hello,

Thanks for your reply! I just checked the wiki article (thanks, @eugen-b for mentioning it!).

I just checked align-check optimal X (X is a number). That said my third partition (swap) was not correctly aligned.

I was able to solve the alignment problem with Manjaro LiveCD and KDE Partition Manager:

I just selected the partition with the wrong start sector, there was a "Resize/Move" option, in that, an "Advanced" drop-down. There, the wrong start sector was stated. There was also a "align partition" checkbox. I unticked that, and then ticked again, then new start sectors were calculated then I just divided this new value with 8/16/... just to be sure. It seemed fine so I started the process which finished successfully in about 4 mins and when I rebooted everything worked fine.

On the working system, I just checked align-check optimal Xagain, and now it is correctly aligned. :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by