Jump to content


Photo

SSD TRIM


  • Please log in to reply
22 replies to this topic

Re: SSD TRIM #21 Dimitrij

  • PLi® Core member
  • 10,300 posts

+347
Excellent

Posted 24 April 2016 - 12:20

Ok.Done...

				MOUNTPOINT="/media/$MDEV"
				mkdir -p "${MOUNTPOINT}"
			fi
+			FLAG=""
+			ROTATIONAL=`cat /sys/block/$DEVBASE/queue/rotational`
+                       # Use 'noatime' option for SSD
+			if [ "${ROTATIONAL}" -eq "0" -a "{$DEVBASE}" != "mmcblk0" ] ; then
+				FLAG="-o noatime"
+			fi
-			if ! mount -t auto /dev/$MDEV "${MOUNTPOINT}" ; then
+			if ! mount -t auto $FLAG /dev/$MDEV "${MOUNTPOINT}" ; then
				rmdir "${MOUNTPOINT}"
			fi
		fi
		;;

/etc/mdev/mdev-mount.sh


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: SSD TRIM #22 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 24 April 2016 - 14:00

The noatime option is also "good enough" for all other devices, since nothing on the box ever use atime (last accessed) for anything. I'd keep it simple and use noatime all the time.

Maybe there's a way to make this default in busybox or so, so that "mount device mountpoint" already assumes "noatime" as options?
Real musicians never die - they just decompose

Re: SSD TRIM #23 Dimitrij

  • PLi® Core member
  • 10,300 posts

+347
Excellent

Posted 24 April 2016 - 16:00

Maybe simple(mdev-mount.sh)?


+		        FLAG="-o noatime"
-			if ! mount -t auto /dev/$MDEV "${MOUNTPOINT}" ; then
+			if ! mount -t auto $FLAG /dev/$MDEV "${MOUNTPOINT}" ; then
				rmdir "${MOUNTPOINT}"

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users