Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: OldAdamUser2 on February 02, 2010, 10:46:46 AM

Title: On SSD drives is there a way to have fstab use noatime?
Post by: OldAdamUser2 on February 02, 2010, 10:46:46 AM
On SSD drives is there a way to have fstab use noatime? And would it be desirable to do so? I've read that it is better to mount SSD drives in this way in order to reduce writing to drives and extend their lives. On the other hand, TC (by loading into ram) may already achieve most of that.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: gerald_clark on February 02, 2010, 06:32:16 PM
How does one determine it is an SSD?
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: bmarkus on February 02, 2010, 08:46:33 PM
How does one determine it is an SSD?

Guess user nows (not always) what he has.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: OldAdamUser2 on February 02, 2010, 08:51:41 PM
Of course, I do know what kind of drives I have on my Eee 900, but I think it's also true that "df -h" will indicate the drive type. SD drives of one type or another will show up as sda, sdb, etc. Hard drives are listed as hda, hdb, etc. Or am I wrong about that?
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: bmarkus on February 02, 2010, 08:58:03 PM
Of course, I do know what kind of drives I have on my Eee 900, but I think it's also true that "df -h" will indicate the drive type. SD drives of one type or another will show up as sda, sdb, etc. Hard drives are listed as hda, hdb, etc. Or am I wrong about that?

hdx indicates IDE drives, while sdx either SCSI, SATA drives or USB sticks. Have no experience but guess SSD depends on the interface type not the drive technology. BTW you can have a CompactFlash drive connected with IDE interface for example just a simple passive adapter or cable required.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: curaga on February 03, 2010, 06:44:16 AM
IDE drives can show up as sd* too, if the libata drivers for them are enabled. Then everything will go over scsi.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: bmarkus on February 03, 2010, 07:08:20 AM
Back to the original question, it can't be used to identify SSD drives. hdparm may help to display vendor, model number and other parameters, like:

Quote
hdparm -I /dev/hda

and grep for SSD if it is mentioned.

You may read this article:

http://www.cyberciti.biz/faq/linux-getting-scsi-ide-harddisk-information/
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: OldAdamUser2 on February 03, 2010, 07:34:55 AM
OK. But if you DO know you have an SD or SSD drive, would it be preferable to have Tiny Core mount it "noatime"? If so, is there a way to do that?
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: bmarkus on February 03, 2010, 07:53:23 AM
OK. But if you DO know you have an SD or SSD drive, would it be preferable to have Tiny Core mount it "noatime"?

IMHO no.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: curaga on February 03, 2010, 07:55:04 AM
Remove the "Added by TC" comment from your SSD line in /etc/fstab, add noatime to the options column, add fstab to backup.

This will not remove the autorecognition for other drives/partitions, only keep the SSD line there.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: pgf on February 03, 2010, 01:51:08 PM
i suspect there's little reason on most tinycore systems to use atime at all, so setting noatime for all drives is probably safe.

however, a good alternative is to set "relatime" instead of atime, which will remove 99% of the disk writes that are caused by atime, while still maintaining the specific semantic of atime which most clients of it are expecting, namely the "was this file read since it was last written?" semantic.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: curaga on February 03, 2010, 02:41:08 PM
We already default to relatime.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: pgf on February 03, 2010, 02:43:10 PM
i should have figured that.  from the thread it didn't sound like it was being considered as an option.  sorry for the noise.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: OldAdamUser2 on February 03, 2010, 04:25:28 PM
Thanks from your comment, pgf. I didn't realize that "relatime" eliminated most of the writes to the drives.
The article referenced below  makes it sound to me as if noatime is still better for SSD drives, but I think I'm persuaded that it is not something I need to worry about.

http://ldn.linuxfoundation.org/blog-entry/ssd’s-journaling-and-noatimerelatime
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: qopit on April 14, 2012, 06:56:02 PM
For anyone else landing on this old thread who really wants noatime (vs the default relatime), or any other mount option, another easy way to do it that avoids mucking with fstab is to simply remount the drive with noatime set:

Code: [Select]
tc@box:~$ mount | grep sda1
/dev/sda1 on /mnt/sda1 type ext4 (rw,nosuid,nodev,relatime,barrier=1,data=ordered)
tc@box:~$ sudo mount -o remount,noatime /mnt/sda1
tc@box:~$ mount | grep sda1
/dev/sda1 on /mnt/sda1 type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)

To do this at every boot, just add mount -o remount,noatime /mnt/sda1 to your /opt/bootlocal.sh, which runs at boot with root privileges.

Not that mucking with fstab is bad, but if you want to avoid any potential problems with the automation/magic in TC's 'rebuildfstab' script, remounting works.
Title: Re: On SSD drives is there a way to have fstab use noatime?
Post by: coreplayer2 on April 15, 2012, 04:32:09 AM
Normally to differentiate between a HDD and an SSD you would test for rotational speed greater than 0.  if speed equals 0 drive is SSD, if speed is greater than 0 drive is HDD

hdparm will report an SSD as "nominal media rotation rate: Solid State Drive"
sudo hdparm -I /dev/sda? | grep 'Rotation'

Since the rotational speed can be misrepresented this next test is considered definitive.

test for random 4k read performance with 8MB/s transfer speed set as a threshold speed.  As very few HDD's are capable of 4K random read performance greater than 2MB/s (iirc there are maybe two SCSI drives which are close to this performance),  any result less than this is definitely a HDD  whilst any result above this clearly indicates an SSD.