Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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".
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.
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.
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.
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.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.