LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2015, 02:18 AM   #1
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 7
Posts: 406
Blog Entries: 4

Rep: Reputation: 80
noatime on ssd drives fstab


Hello,
I have been reading about putting noatime in the fstab on ssd drives. Is it a good thing to do?
My system has the first drive is an ssd where the system lives and the second drive is just an "normal rotating hard drive".

cheers
 
Old 11-24-2015, 02:22 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
yes, usually it is suggested
 
Old 11-24-2015, 05:38 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Always add noatime, except to your mail servers cache partition.

noatime is an option that reduces un-needed writes and cuts write overhead for ANY drive. With SSD it may also extend the life of the drive. There are certain applications that make use of atime values (certain mail programs), but if you are not running one of those it will never have a negative impact.

If you use the mutt mail client, you might want to put your mail folder on the rotational drive and allow atime values to be used there. The compromise solution is to use 'reltime' mount option for volumes where atime should be used, but reduced writes are desired.

Last edited by wpeckham; 11-24-2015 at 05:46 AM.
 
Old 11-24-2015, 08:05 AM   #4
Rawcous
Member
 
Registered: Jan 2014
Location: Farnborough, Hampshire - UK
Distribution: SCO UNIX -> Fedora (Core) -> CentOS -> RedHat
Posts: 128

Rep: Reputation: 48
Hello NigelC,

To take what you have done a couple of steps further in terms of reducing write overhead on the SSD, you could:

Split the mechanical drive into 4 partitions

1. Move the swap partition to partition 1 of 4 on the mechanical drive. - SWAP parition
2. Move the mail files /var/spool/mail? as suggested by "wpeckham" to partition 2 of 4 on the mechanical drive - EXT4 partition
3. Move the log files /var/log to partition 3 of 4 on the mechanical drive - EXT4 partition
4. Set partition 4 of 4 to be your data partition - EXT4 partition.

By combining all of the above the no. of write cycles especially regarding the log files would be greatly reduced. The downside being that you lose some of the performance benefits for purchasing the SSD in the first place... The positive being that if your Linux install dies you still have a copy of your mail / log / data files.

Regards,

Rawcous
 
Old 11-24-2015, 09:17 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

Modern SSD do not have the same issues with write as older SSD technologies. Newer SSD have better controllers and use 'MLC' for most consumer grade drives. To me 2 million hours is an long period for a life of the drive to expect any errors or any at all. I as a user will replace the hardware system before any failures due to write issue for cells.

You could spend more for 'SLC' based SSD but for consumer usage it would be a big dent in the wallet and over-kill. I have been using 'SSD' on all my systems and do not have issues with any since the systems are properly configured. As a informed consumer a user should read manufacture data/specs instead of relying on 'FUD'. One of my systems with a Crucial SSD;
Code:
cat /etc/fstab
/dev/sda2        swap             swap        defaults         0   0
/dev/sda5        /                ext4        defaults,noatime,discard         1   1
/dev/sda6        /home            ext4        defaults,noatime,discard         1   2
/dev/sda7        /usr             ext4        defaults,noatime,discard         1   2
/dev/sda8        /var             ext4        defaults,noatime,discard         1   2
/dev/sda9        /tmp             ext4        defaults,noatime,discard         1   2
#/dev/sdb2        /mnt/win7        ntfs-3g     fmask=111,dmask=000 1   0
/dev/sdb1        /mnt/win7        ntfs-3g     fmask=111,dmask=000 1   0

#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0

cat /etc/rc.d/rc.local
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
#
#09-25-12 gws 20:07
#
#08-20-12 gws 14:38
#set minimum swappiness
#
echo 1 > /proc/sys/vm/swappiness

#08-20-12 gws
#sets scheduler for SSD to 'noop'
#SSD=(device ID's of all 'SSD': see note below)
#Note Information revised from ArchWiki;

#This provides the links listed with targets information to place in bash array
#'SSD= ( ) parentheses in below 'SSD= ( );

#ls -l /dev/disk/by-id
#lrwxrwxrwx 1 root root  9 Aug 19 11:27 ata-OCZ-AGILITY3_OCZ-C93VFN4X0532CVMP -> ../../sda

#SSD=(ata-Crucial_CT256MX100SSD1_14270C86314F)
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
#
#09-25-12 gws 20:07
#
#08-20-12 gws 14:38
#set minimum swappiness
#
echo 1 > /proc/sys/vm/swappiness

#08-20-12 gws
#sets scheduler for SSD to 'noop'
#SSD=(device ID's of all 'SSD': see note below)
#Note Information revised from ArchWiki;

#This provides the links listed with targets information to place in bash array
#'SSD= ( ) parentheses in below 'SSD= ( );

#ls -l /dev/disk/by-id
#lrwxrwxrwx 1 root root  9 Aug 19 11:27 ata-OCZ-AGILITY3_OCZ-C93VFN4X0532CVMP -> ../../sda

#Wed Nov 19 13:43:36 CST 2014 GWS change to new drive 
# ata-Crucial_CT256MX100SSD1_14270C86314F

SSD=(ata-Crucial_CT256MX100SSD1_14270C86314F)

declare -i i=0
while [ "${SSD[$i]}" != "" ]; do
  NODE=`ls -l /dev/disk/by-id/${SSD[$i]} | awk '{ print $NF }' | sed -e 's/[/\.]//g'`
  echo noop > /sys/block/$NODE/queue/scheduler
  i=i+1
done

#08-20-12 gws 14:45
#get some additional gain by setting up a write-back cache
hdparm -W1 /dev/sda   #where x= a,b,c,d...

#
#Need to do a bumblebeed install
#11-19-14 gws 14:03

#09-20-12:16:14 gws bumblebee
#if [ -x /etc/rc.d/rc.bumblebeed ]; then
#     /etc/rc.d/rc.bumblebeed start
#fi


declare -i i=0
while [ "${SSD[$i]}" != "" ]; do
  NODE=`ls -l /dev/disk/by-id/${SSD[$i]} | awk '{ print $NF }' | sed -e 's/[/\.]//g'`
  echo noop > /sys/block/$NODE/queue/scheduler
  i=i+1
done

#08-20-12 gws 14:45
#get some additional gain by setting up a write-back cache
hdparm -W1 /dev/sda   #where x= a,b,c,d...

#
#09-20-12:16:14 gws bumblebee
if [ -x /etc/rc.d/rc.bumblebeed ]; then
     /etc/rc.d/rc.bumblebeed start
fi
User's be-aware!

I do use different manufactures but find ocz a good bang for the buck. Prices are falling daily, I use NewEgg all the time. A recent OCZ purchase, look at the specs & price for a 240GB SSD.

Hope this helps.
Have fun & enjoy!
 
Old 11-24-2015, 09:41 AM   #6
Rawcous
Member
 
Registered: Jan 2014
Location: Farnborough, Hampshire - UK
Distribution: SCO UNIX -> Fedora (Core) -> CentOS -> RedHat
Posts: 128

Rep: Reputation: 48
Hello,

I have kind of already adopted "OneBuck"'s philisophy reagrding modern SSD's in that although I have moved swap, log and mail to another physical device - I must confess that this other physical device I have used here is in fact, yes you've got it - another SSD. I simply like to keep my data according to type on separate partitions as per "OneBuck"'s dump of his /etc/fstab file. I am no longer going to obsess about the no. of write cycles etc. and simply enjoy the benefits of the purchase - speed / reliabilty etc.

Regards,

Rawcous
 
Old 11-24-2015, 01:33 PM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I had thought that atime was deprecated and relatime preferred, where needed? I seem to recall Linux suggested that relatime be the default, has this not happened yet?
Personally, though, I use noatime on my home system as I don't need atime so don't want the, admittedly probably negligible, write overhead.
 
Old 11-25-2015, 09:01 PM   #8
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 7
Posts: 406

Original Poster
Blog Entries: 4

Rep: Reputation: 80
Hi,
This is how it is at the moment. The system does use not any swap as there is 24 Gig of Ram.

Code:
cat /etc/fstab
# Entry for /dev/sda1 :
UUID=2bb07894-5cbe-4359-8db8-8adb82b7673f / ext4 defaults 1 1
# Entry for /dev/sdb1 :
UUID=1db2ed92-3662-4a0b-b50c-5a2f4de6a797 /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=ea7969f3-1364-4e4c-a799-0b0073ef1b43 swap swap defaults 0 0

df
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         12G     0   12G   0% /dev
tmpfs            12G  1.8M   12G   1% /dev/shm
tmpfs            12G  924K   12G   1% /run
/dev/sda1       102G  8.1G   89G   9% /
tmpfs            12G     0   12G   0% /sys/fs/cgroup
tmpfs            12G  3.1M   12G   1% /tmp
/dev/sdb1       1.8T  255G  1.5T  15% /home
tmpfs           2.4G   16K  2.4G   1% /run/user/500
cheers
 
Old 11-25-2015, 10:32 PM   #9
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 7
Posts: 406

Original Poster
Blog Entries: 4

Rep: Reputation: 80
It does not work??

Here is the new fstab:
Code:
 cat /etc/fstab
# Entry for /dev/sda1 :
UUID=2bb07894-5cbe-4359-8db8-8adb82b7673f / ext4 defaults,noatime 1 1
# Entry for /dev/sdb1 :
UUID=1db2ed92-3662-4a0b-b50c-5a2f4de6a797 /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=ea7969f3-1364-4e4c-a799-0b0073ef1b43 swap swap defaults 0 0
[nigel@endor ~]$
And mount says:
Code:
mount |grep /dev/sda1
/dev/sda1 on / type ext4 (rw,relatime,data=ordered)
[nigel@endor ~]$
cheers
 
  


Reply

Tags
noatime, ssd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is noatime? How can I mount a partition with noatime? abefroman Linux - Software 6 03-17-2012 03:26 PM
ssd drives tutorial portia Linux - Hardware 2 11-17-2011 08:07 AM
[SOLVED] script to delete files older than X days fstab has noatime enabled panseluta Linux - Server 2 07-27-2011 12:18 PM
SSD drives McDivot Linux - Newbie 2 09-28-2010 05:00 PM
add noatime to /etc/fstab theacerguy Linux - General 5 08-31-2009 02:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration