1 |
> Hello list, |
2 |
> |
3 |
> A week ago the 2.5" drive on my Atom LAN mini-server failed, so I decided |
4 |
> to |
5 |
> bite the bullet and replace it with an SSD. Interesting times! |
6 |
> |
7 |
> Today I took the box off-line and backed up the entire, newly built system |
8 |
> to |
9 |
> external USB2 disk. The 3GB took four minutes, a third or a quarter of the |
10 |
> previous time on the spinning disk. Good news! |
11 |
> |
12 |
> I find though that fstrim can't operate on /boot, which is a separate ext2 |
13 |
> file |
14 |
> system. It reports: |
15 |
> fstrim: /boot: FITRIM ioctl failed: Inappropriate ioctl for device |
16 |
> Is this because it's an ext2 partition, not ext4 like the rest of them? |
17 |
|
18 |
Yes this is correct. |
19 |
trim basically requires the FS to mark inodes as ready for deletion [1] |
20 |
a good intro to ssd trim is here [2] though i use online trim not offline |
21 |
on my laptopp. |
22 |
|
23 |
|
24 |
> Man |
25 |
> fstrim makes no mention of file-system types. |
26 |
> |
27 |
> Maybe I've not laid out the partitions properly. I used gparted from a |
28 |
> recent |
29 |
> System Rescue CD (http://sysresccd.org), which said it was leaving 1MB |
30 |
> unused |
31 |
> before /dev/sda1. |
32 |
> |
33 |
> While I'm here, would anyone like to suggest suitable parameters to mkfs |
34 |
> for |
35 |
> any of my file-systems? Here's the fstab: |
36 |
> |
37 |
> /dev/sda1 /boot ext2 noauto,relatime 1 |
38 |
> 2 |
39 |
> /dev/sda2 none swap sw 0 |
40 |
> 0 |
41 |
> /dev/sda5 / ext4 relatime 0 |
42 |
> 1 |
43 |
|
44 |
you might want this to read relatime,discard to handle the trim |
45 |
automagically. if you are concerned about writes i'd suggest noatime for |
46 |
all of these |
47 |
|
48 |
> /dev/sda6 /var ext4 relatime 0 |
49 |
> 2 |
50 |
> /dev/sda7 /home ext4 relatime 0 |
51 |
> 2 |
52 |
> /dev/sda8 /var/cache/squid ext4 relatime 0 |
53 |
> 3 |
54 |
> /dev/sda9 /usr/portage ext4 relatime 0 |
55 |
> 3 |
56 |
> /dev/sda10 /usr/portage/packages ext4 relatime 0 |
57 |
> 4 |
58 |
> /dev/sda11 /usr/local ext4 relatime 0 |
59 |
> 2 |
60 |
> proc /proc proc defaults 0 |
61 |
> 0 |
62 |
> tmpfs /tmp tmpfs nodev,nosuid 0 |
63 |
> 0 |
64 |
> tmpfs /var/tmp tmpfs nodev,nosuid 0 |
65 |
> 0 |
66 |
> shm /dev/shm tmpfs nodev,nosuid,noexec 0 |
67 |
> 0 |
68 |
> |
69 |
> I created all the ext4 file-systems with -O ^has_journal to avoid |
70 |
> concentrated |
71 |
> wear. Is this still a good idea nowadays? I'm happy to sacrifice the |
72 |
> comfort of |
73 |
> journalling since recovering this small box from backup is so quick and |
74 |
> easy. |
75 |
> Of course I did plenty of googling before doing anything and picked out |
76 |
> what |
77 |
> still seemed appropriate, but I could easily have missed something |
78 |
> important. |
79 |
> |
80 |
|
81 |
my 2c is that if you have this little box lose power for any reason, if |
82 |
you have a journal and have data ordered you will have a relatively |
83 |
consistent drive. without a journal corruption is missed until you need |
84 |
it. |
85 |
e2fsck with journal also much faster. |
86 |
just depends what the box is doing - if you are expecting many writes (i |
87 |
notice squidcache there) use a journal. |
88 |
if it is a router only, or media pc then you can worry less, and just |
89 |
format the squidcache partition if needed. |
90 |
|
91 |
> -- |
92 |
> Regards |
93 |
> Peter |
94 |
> |
95 |
> |
96 |
> |
97 |
[1] http://en.wikipedia.org/wiki/Trim_(computing) |
98 |
[2] http://www.webupd8.org/2013/01/enable-trim-on-ssd-solid-state-drives.html |