Swap se nepripoji

Ahoj, mam problem s pripojenim swap oddilu. Na mSATA SSD jsem si vytvoril 2GB oddil, ktery bych chtel pripojit jako swap, ale system ho nepripoji. Nize je vystup z fdisk, blkid a konfiguracnou soubor fstab.

root@turris:~# fdisk -l /dev/sdc
Disk /dev/sdc: 14.9 GiB, 16013942784 bytes, 31277232 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: 0xcbf3401b

Device     Boot Start     End Sectors Size Id Type
/dev/sdc1        2048 4196351 4194304   2G 82 Linux swap / Solaris

root@turris:~# blkid
/dev/mmcblk0p1: UUID="1f143d68-90fa-4787-9422-26f2f1503fe0" UUID_SUB="5218a1aa-1eec-402b-   ba9d-ec9734be65b4" TYPE="btrfs" PARTUUID="ccc72422-01"
/dev/sda: LABEL="SATA" UUID="bff9d1bd-b174-461d-9410-b4a36c322270" UUID_SUB="bb184029-536e-4ca1-912e-6f94b022dbd1" TYPE="btrfs"
/dev/sdb: LABEL="SATA" UUID="bff9d1bd-b174-461d-9410-b4a36c322270" UUID_SUB="263e0611-3190-47de-a209-6359de46bd6e" TYPE="btrfs"
/dev/mmcblk0: PTUUID="ccc72422" PTTYPE="dos"
/dev/sdc1: PARTUUID="cbf3401b-01"

root@turris:~# cat /etc/config/fstab 
config global
    option anon_swap '0'
    option anon_mount '0'
    option auto_swap '1'
    option auto_mount '1'
    option delay_root '5'
    option check_fs '0'

config swap
    option enabled '1'
    option device '/dev/sdc1'

Po rebootu je v logu videt toto:

root@turris:~# grep swap /var/log/messages 
2018-05-07T12:24:10+02:00 warning kernel[]: [   33.516782] 0 pages in swap cache
2018-05-07T12:24:10+02:00 warning kernel[]: [   33.525346] Free swap  = 0kB
2018-05-07T12:24:10+02:00 warning kernel[]: [   33.528230] Total swap = 0kB

Po vytvoreni partition “linux swap” na ‘/dev/sdc1’ je jeste potreba provest “mkswap /dev/sdc1” a az pak zkusit pripojit. Tvuj blkid vypisuje ze to je PTTYPE=dos, ale mel by si pak (po mkswap) videt TYPE=swap.

/dev/sdc1: LABEL="MyLabel" UUID="xxxxxxxxxxxxxxxxxxx" TYPE="swap" PARTUUID="xxxxxxxxxxxxxxxxxxxxxxxxxx"

1 Like

Jaj, diky, to jsem prehledl.