LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   noatime on ssd drives fstab (https://www.linuxquestions.org/questions/linux-newbie-8/noatime-on-ssd-drives-fstab-4175559737/)

nigelc 11-24-2015 02:18 AM

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

pan64 11-24-2015 02:22 AM

yes, usually it is suggested

wpeckham 11-24-2015 05:38 AM

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.

Rawcous 11-24-2015 08:05 AM

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

onebuck 11-24-2015 09:17 AM

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!
:hattip:

Rawcous 11-24-2015 09:41 AM

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

273 11-24-2015 01:33 PM

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.

nigelc 11-25-2015 09:01 PM

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

nigelc 11-25-2015 10:32 PM

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


All times are GMT -5. The time now is 10:13 AM.