WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: On SSD drives is there a way to have fstab use noatime?  (Read 7777 times)

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
On SSD drives is there a way to have fstab use noatime?
« 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.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #1 on: February 02, 2010, 06:32:16 PM »
How does one determine it is an SSD?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #2 on: February 02, 2010, 08:46:33 PM »
How does one determine it is an SSD?

Guess user nows (not always) what he has.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #3 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?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #4 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.
« Last Edit: February 02, 2010, 09:00:39 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11077
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #5 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.
The only barriers that can stop you are the ones you create yourself.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #6 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/
« Last Edit: February 03, 2010, 07:17:37 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #7 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?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #8 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.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11077
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #9 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.
The only barriers that can stop you are the ones you create yourself.

Offline pgf

  • Newbie
  • *
  • Posts: 4
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #10 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.

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11077
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #11 on: February 03, 2010, 02:41:08 PM »
We already default to relatime.
The only barriers that can stop you are the ones you create yourself.

Offline pgf

  • Newbie
  • *
  • Posts: 4
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #12 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.

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #13 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

Offline qopit

  • Jr. Member
  • **
  • Posts: 81
Re: On SSD drives is there a way to have fstab use noatime?
« Reply #14 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.