YunoHost-Apps / Experimental_helpers

6 stars 12 forks source link

Do not add swap on a flash drive #45

Closed maniackcrudelis closed 5 years ago

maniackcrudelis commented 5 years ago

For info

According to https://www.kernel.org/doc/Documentation/block/queue-sysfs.txt, /sys/block/sda/queue/rotational gives 1 for a hard drive, 0 for a flash drive.

findmnt / --nofsroot --uniq --output source --noheadings --first-only gives the partition on which the system is installed.

lsblk /dev/mmcblk0p2 --output PKNAME --noheadings gives the drives above the partition.

Still, we do not separate SSD drive and SD card. Should we ?

kay0u commented 5 years ago

For what I can read, it's no more a problem to swap on a "recent" SSD, but we can still avoid swapping on SSD, or put the swapinnes close to 0 if it's a flash drive?

maniackcrudelis commented 5 years ago

Unless we find a way to detect that it's a SD card, not a SSD.

kay0u commented 5 years ago

https://stackoverflow.com/a/56021015/9931623

maniackcrudelis commented 5 years ago

Ok, let's say so then. Now, this should be implemented.