* [gentoo-user] SSD success - I think
@ 2014-02-22 14:47 Peter Humphrey
2014-02-22 15:24 ` thegeezer
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Peter Humphrey @ 2014-02-22 14:47 UTC (permalink / raw
To: gentoo-user
Hello list,
A week ago the 2.5" drive on my Atom LAN mini-server failed, so I decided to
bite the bullet and replace it with an SSD. Interesting times!
Today I took the box off-line and backed up the entire, newly built system to
external USB2 disk. The 3GB took four minutes, a third or a quarter of the
previous time on the spinning disk. Good news!
I find though that fstrim can't operate on /boot, which is a separate ext2 file
system. It reports:
fstrim: /boot: FITRIM ioctl failed: Inappropriate ioctl for device
Is this because it's an ext2 partition, not ext4 like the rest of them? Man
fstrim makes no mention of file-system types.
Maybe I've not laid out the partitions properly. I used gparted from a recent
System Rescue CD (http://sysresccd.org), which said it was leaving 1MB unused
before /dev/sda1.
While I'm here, would anyone like to suggest suitable parameters to mkfs for
any of my file-systems? Here's the fstab:
/dev/sda1 /boot ext2 noauto,relatime 1 2
/dev/sda2 none swap sw 0 0
/dev/sda5 / ext4 relatime 0 1
/dev/sda6 /var ext4 relatime 0 2
/dev/sda7 /home ext4 relatime 0 2
/dev/sda8 /var/cache/squid ext4 relatime 0 3
/dev/sda9 /usr/portage ext4 relatime 0 3
/dev/sda10 /usr/portage/packages ext4 relatime 0 4
/dev/sda11 /usr/local ext4 relatime 0 2
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs nodev,nosuid 0 0
tmpfs /var/tmp tmpfs nodev,nosuid 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
I created all the ext4 file-systems with -O ^has_journal to avoid concentrated
wear. Is this still a good idea nowadays? I'm happy to sacrifice the comfort of
journalling since recovering this small box from backup is so quick and easy.
Of course I did plenty of googling before doing anything and picked out what
still seemed appropriate, but I could easily have missed something important.
--
Regards
Peter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] SSD success - I think
2014-02-22 14:47 [gentoo-user] SSD success - I think Peter Humphrey
@ 2014-02-22 15:24 ` thegeezer
2014-02-22 19:48 ` Daniel Troeder
2014-02-22 17:19 ` Michael Hampicke
2014-02-23 1:01 ` Peter Humphrey
2 siblings, 1 reply; 6+ messages in thread
From: thegeezer @ 2014-02-22 15:24 UTC (permalink / raw
To: gentoo-user
> Hello list,
>
> A week ago the 2.5" drive on my Atom LAN mini-server failed, so I decided
> to
> bite the bullet and replace it with an SSD. Interesting times!
>
> Today I took the box off-line and backed up the entire, newly built system
> to
> external USB2 disk. The 3GB took four minutes, a third or a quarter of the
> previous time on the spinning disk. Good news!
>
> I find though that fstrim can't operate on /boot, which is a separate ext2
> file
> system. It reports:
> fstrim: /boot: FITRIM ioctl failed: Inappropriate ioctl for device
> Is this because it's an ext2 partition, not ext4 like the rest of them?
Yes this is correct.
trim basically requires the FS to mark inodes as ready for deletion [1]
a good intro to ssd trim is here [2] though i use online trim not offline
on my laptopp.
> Man
> fstrim makes no mention of file-system types.
>
> Maybe I've not laid out the partitions properly. I used gparted from a
> recent
> System Rescue CD (http://sysresccd.org), which said it was leaving 1MB
> unused
> before /dev/sda1.
>
> While I'm here, would anyone like to suggest suitable parameters to mkfs
> for
> any of my file-systems? Here's the fstab:
>
> /dev/sda1 /boot ext2 noauto,relatime 1
> 2
> /dev/sda2 none swap sw 0
> 0
> /dev/sda5 / ext4 relatime 0
> 1
you might want this to read relatime,discard to handle the trim
automagically. if you are concerned about writes i'd suggest noatime for
all of these
> /dev/sda6 /var ext4 relatime 0
> 2
> /dev/sda7 /home ext4 relatime 0
> 2
> /dev/sda8 /var/cache/squid ext4 relatime 0
> 3
> /dev/sda9 /usr/portage ext4 relatime 0
> 3
> /dev/sda10 /usr/portage/packages ext4 relatime 0
> 4
> /dev/sda11 /usr/local ext4 relatime 0
> 2
> proc /proc proc defaults 0
> 0
> tmpfs /tmp tmpfs nodev,nosuid 0
> 0
> tmpfs /var/tmp tmpfs nodev,nosuid 0
> 0
> shm /dev/shm tmpfs nodev,nosuid,noexec 0
> 0
>
> I created all the ext4 file-systems with -O ^has_journal to avoid
> concentrated
> wear. Is this still a good idea nowadays? I'm happy to sacrifice the
> comfort of
> journalling since recovering this small box from backup is so quick and
> easy.
> Of course I did plenty of googling before doing anything and picked out
> what
> still seemed appropriate, but I could easily have missed something
> important.
>
my 2c is that if you have this little box lose power for any reason, if
you have a journal and have data ordered you will have a relatively
consistent drive. without a journal corruption is missed until you need
it.
e2fsck with journal also much faster.
just depends what the box is doing - if you are expecting many writes (i
notice squidcache there) use a journal.
if it is a router only, or media pc then you can worry less, and just
format the squidcache partition if needed.
> --
> Regards
> Peter
>
>
>
[1] http://en.wikipedia.org/wiki/Trim_(computing)
[2] http://www.webupd8.org/2013/01/enable-trim-on-ssd-solid-state-drives.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] SSD success - I think
2014-02-22 14:47 [gentoo-user] SSD success - I think Peter Humphrey
2014-02-22 15:24 ` thegeezer
@ 2014-02-22 17:19 ` Michael Hampicke
2014-02-22 19:35 ` Facundo Curti
2014-02-23 1:01 ` Peter Humphrey
2 siblings, 1 reply; 6+ messages in thread
From: Michael Hampicke @ 2014-02-22 17:19 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2514 bytes --]
Am 22.02.2014 15:47, schrieb Peter Humphrey:
>
> I find though that fstrim can't operate on /boot, which is a separate ext2 file
> system. It reports:
> fstrim: /boot: FITRIM ioctl failed: Inappropriate ioctl for device
> Is this because it's an ext2 partition, not ext4 like the rest of them? Man
> fstrim makes no mention of file-system types.
Yes, only ext4 of the extX file systems supports discard/trim
>
> Maybe I've not laid out the partitions properly. I used gparted from a recent
> System Rescue CD (http://sysresccd.org), which said it was leaving 1MB unused
> before /dev/sda1.
>
> While I'm here, would anyone like to suggest suitable parameters to mkfs for
> any of my file-systems? Here's the fstab:
>
> /dev/sda1 /boot ext2 noauto,relatime 1 2
> /dev/sda2 none swap sw 0 0
> /dev/sda5 / ext4 relatime 0 1
> /dev/sda6 /var ext4 relatime 0 2
> /dev/sda7 /home ext4 relatime 0 2
> /dev/sda8 /var/cache/squid ext4 relatime 0 3
> /dev/sda9 /usr/portage ext4 relatime 0 3
> /dev/sda10 /usr/portage/packages ext4 relatime 0 4
> /dev/sda11 /usr/local ext4 relatime 0 2
> proc /proc proc defaults 0 0
> tmpfs /tmp tmpfs nodev,nosuid 0 0
> tmpfs /var/tmp tmpfs nodev,nosuid 0 0
> shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
>
> I created all the ext4 file-systems with -O ^has_journal to avoid concentrated
> wear. Is this still a good idea nowadays? I'm happy to sacrifice the comfort of
> journalling since recovering this small box from backup is so quick and easy.
> Of course I did plenty of googling before doing anything and picked out what
> still seemed appropriate, but I could easily have missed something important.
>
I used the default options for ext4 on my SSDs. The only thing I do is,
I set noatime in fstab. But I do this for all file systems.
My oldest SSD is from 2008/2009, I'm not sure. It's a 32GB SuperTalent,
and it still runs great today. And I did not care for low writes etc. I
just used it like any other disk.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] SSD success - I think
2014-02-22 17:19 ` Michael Hampicke
@ 2014-02-22 19:35 ` Facundo Curti
0 siblings, 0 replies; 6+ messages in thread
From: Facundo Curti @ 2014-02-22 19:35 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 3429 bytes --]
>
> > Man
> > fstrim makes no mention of file-system types.
> >
> > Maybe I've not laid out the partitions properly. I used gparted from a
> > recent
> > System Rescue CD (http://sysresccd.org), which said it was leaving 1MB
> > unused
> > before /dev/sda1.
> >
> > While I'm here, would anyone like to suggest suitable parameters to mkfs
> > for
> > any of my file-systems? Here's the fstab:
> >
> > /dev/sda1 /boot ext2 noauto,relatime 1
> > 2
> > /dev/sda2 none swap sw 0
> > 0
> > /dev/sda5 / ext4 relatime 0
> > 1
>
> you might want this to read relatime,discard to handle the trim
> automagically. if you are concerned about writes i'd suggest noatime for
> all of these
I agree. Also I recommend async, nodiratime and norealtime. All these will
make a better performance. See man mount.
Bytes! ;)
2014-02-22 14:19 GMT-03:00 Michael Hampicke <mh@hadt.biz>:
> Am 22.02.2014 15:47, schrieb Peter Humphrey:
> >
> > I find though that fstrim can't operate on /boot, which is a separate
> ext2 file
> > system. It reports:
> > fstrim: /boot: FITRIM ioctl failed: Inappropriate ioctl for device
> > Is this because it's an ext2 partition, not ext4 like the rest of them?
> Man
> > fstrim makes no mention of file-system types.
>
> Yes, only ext4 of the extX file systems supports discard/trim
>
> >
> > Maybe I've not laid out the partitions properly. I used gparted from a
> recent
> > System Rescue CD (http://sysresccd.org), which said it was leaving 1MB
> unused
> > before /dev/sda1.
> >
> > While I'm here, would anyone like to suggest suitable parameters to mkfs
> for
> > any of my file-systems? Here's the fstab:
> >
> > /dev/sda1 /boot ext2 noauto,relatime
> 1 2
> > /dev/sda2 none swap sw
> 0 0
> > /dev/sda5 / ext4 relatime
> 0 1
> > /dev/sda6 /var ext4 relatime
> 0 2
> > /dev/sda7 /home ext4 relatime
> 0 2
> > /dev/sda8 /var/cache/squid ext4 relatime
> 0 3
> > /dev/sda9 /usr/portage ext4 relatime
> 0 3
> > /dev/sda10 /usr/portage/packages ext4 relatime
> 0 4
> > /dev/sda11 /usr/local ext4 relatime
> 0 2
> > proc /proc proc defaults
> 0 0
> > tmpfs /tmp tmpfs nodev,nosuid
> 0 0
> > tmpfs /var/tmp tmpfs nodev,nosuid
> 0 0
> > shm /dev/shm tmpfs nodev,nosuid,noexec
> 0 0
> >
> > I created all the ext4 file-systems with -O ^has_journal to avoid
> concentrated
> > wear. Is this still a good idea nowadays? I'm happy to sacrifice the
> comfort of
> > journalling since recovering this small box from backup is so quick and
> easy.
> > Of course I did plenty of googling before doing anything and picked out
> what
> > still seemed appropriate, but I could easily have missed something
> important.
> >
>
> I used the default options for ext4 on my SSDs. The only thing I do is,
> I set noatime in fstab. But I do this for all file systems.
>
> My oldest SSD is from 2008/2009, I'm not sure. It's a 32GB SuperTalent,
> and it still runs great today. And I did not care for low writes etc. I
> just used it like any other disk.
>
>
[-- Attachment #2: Type: text/html, Size: 5065 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] SSD success - I think
2014-02-22 15:24 ` thegeezer
@ 2014-02-22 19:48 ` Daniel Troeder
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Troeder @ 2014-02-22 19:48 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 620 bytes --]
Am 22.02.2014 16:24, schrieb thegeezer@thegeezer.net:
> you might want this to read relatime,discard to handle the trim
> automagically. if you are concerned about writes i'd suggest noatime for
> all of these
"noatime" yes - you need atimes only with _ancient_ news/mail
servers/clients.
But I'd recommend to use offline discard with a daily cron job
(https://wiki.gentoo.org/wiki/SSD#cron). This results in way less writes
during the day. Not sure if the total number of writes will be lower as
well.
As long as the SSD is not >80% full (all partitions included) you don't
need to worry to much anyway.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] SSD success - I think
2014-02-22 14:47 [gentoo-user] SSD success - I think Peter Humphrey
2014-02-22 15:24 ` thegeezer
2014-02-22 17:19 ` Michael Hampicke
@ 2014-02-23 1:01 ` Peter Humphrey
2 siblings, 0 replies; 6+ messages in thread
From: Peter Humphrey @ 2014-02-23 1:01 UTC (permalink / raw
To: gentoo-user
On Saturday 22 Feb 2014 14:47:54 I wrote:
--->8
> ... would anyone like to suggest suitable parameters to mkfs for any of my
> file-systems? Here's the fstab:
--->8
Thank you gents for all your comments. I'm grateful. Here's what I think I
should do as a result:
1. Keep relatime in preference to noatime, to avoid getting access times
earlier than modification times. Man mount says mutt dislikes that condition,
and it looks like it shouldn't cost much in writes.
2. Add async and nodiratime, which I hadn't spotted. I couldn't find
norealtime in man mount.
3. Reinstate journalling to all the ext4 partitions.
4. Not try to fstrim the ext2 /boot partition.
5. Keep running the cron job (which I forgot to mention last time - sorry)
to run fstrim -v daily on all ext4 partitions.
There's also the question of suitable parameters to mke2fs to suit a partition
to /usr/portage, /usr/portage/packages and /var/cache/squid. I've left these
at the defaults but maybe I should set them specifically.
Once again, many thanks to the several people who offered advice. I can go to
bed happy now!
--
Regards
Peter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-02-23 1:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-22 14:47 [gentoo-user] SSD success - I think Peter Humphrey
2014-02-22 15:24 ` thegeezer
2014-02-22 19:48 ` Daniel Troeder
2014-02-22 17:19 ` Michael Hampicke
2014-02-22 19:35 ` Facundo Curti
2014-02-23 1:01 ` Peter Humphrey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox