NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

SSD TRIM / "discard" works after a remount with mount -a?




I have a scenario where I have several NetBSD systems which were just upgraded to SSDs. I forgot to turn on discard (TRIM) support on the drives when I first put them in. So, here is my plan, anyone see a problem with my assumptions (FYI, these are all NetBSD 7 x86_64) ?

1. Edit /etc/fstab, and add the "discard" option to all FFS file systems

2. Run "mount -a" which should re-mount the affected file systems  with
   the newly added option. I'm assuming this work for the trim/discard
   opton.

3. dd if=/dev/zero bs=4096k of=/my/affected/file/system/DELETEME.000
   I'm assuming short blocks get written as partials.

4. "sync" which I'm assuming will make sure that every byte actually gets
   written to the device and not just cache.

5. "rm /my/affected/file/system/DELETEME.000" and I'm assuming that the
   discard operations will kick in after the delete.

My goals:

1. Enable TRIM / discard on the fly without rebooting.

2. Fix the non-TRIM'd blocks by filling the device with a big zero-file
   and then deleting it.

Thanks,
  Swift


Home | Main Index | Thread Index | Old Index