Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started 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.
-
How does one determine it is an SSD?
-
How does one determine it is an SSD?
Guess user nows (not always) what he has.
-
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?
-
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.
-
IDE drives can show up as sd* too, if the libata drivers for them are enabled. Then everything will go over scsi.
-
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:
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/
-
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?
-
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.
-
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.
-
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.
-
We already default to relatime.
-
i should have figured that. from the thread it didn't sound like it was being considered as an option. sorry for the noise.
-
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
-
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:
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.
-
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.