Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2018 22:11:03 -0500
From:      Allan Jude <allanjude@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: How to use trim command ?
Message-ID:  <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org>
In-Reply-To: <20181201.093153.893601099798031027.ish@amail.plala.or.jp>
References:  <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--vjvPeIPvmlhKGhFqOg4wpwU6wFjzugN23
Content-Type: multipart/mixed; boundary="ooQR7IA48vWSxYni6kZKmE7q6v76f972L";
 protected-headers="v1"
From: Allan Jude <allanjude@freebsd.org>
To: freebsd-hackers@freebsd.org
Message-ID: <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org>
Subject: Re: How to use trim command ?
References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp>
 <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net>
 <20181201.093153.893601099798031027.ish@amail.plala.or.jp>
In-Reply-To: <20181201.093153.893601099798031027.ish@amail.plala.or.jp>

--ooQR7IA48vWSxYni6kZKmE7q6v76f972L
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 2018-11-30 19:31, Masachika ISHIZUKA wrote:
>>>   I'm using FreeBSD 13.0-CURRENT r341327.
>>>   I want to use trim command.
>>
>> It seems this partition is in use (mounted?) and GEOM won't allow to w=
rite
>> to opened partition, you need to close it first (unmount).
>> Be warned: trim will destroy all data in the partition.
>=20
>   Thank you for reply.
>=20
>   I misunderstood trim was equivalent to fstrim in linux.
>   I undotstood that the trim command is the SSD bulk erase tool.
>=20

If you want to enable TRIM on a UFS filesystem, tunefs is the command
you are looking for.

The equivalent to fstrim for UFS is fsck_ffs -E:

Clear unallocated blocks, notifying the underlying device that they are
not used and that their contents may be discarded.  This is useful for
filesystems which have been mounted on systems without TRIM support, or
with TRIM support disabled, as well as filesystems which have been
copied from one device to another.

See also the -E and -t flags of newfs(8), and the -t flag of tunefs(8).


--=20
Allan Jude


--ooQR7IA48vWSxYni6kZKmE7q6v76f972L--

--vjvPeIPvmlhKGhFqOg4wpwU6wFjzugN23
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQIcBAEBAgAGBQJcAfvKAAoJEBmVNT4SmAt+1LwP/1qkW+dH5ri7/2CoGEFs1CTu
CHRDIoCebpIEEopQ3xNYwZHEUAeelAqgT8PQjUrHoDBazsRBMrsG2Z37zXWP3ore
gEVVl/JIVm4bhPGcgAVAWw1gfQ0TyzWVbc99bUyXJHFpWCqdWBWa62xLZZ6tnlTh
AZK04SwlQ/nhDsnM490xSVDsxjaPyG4O61/IJmhwkdieXAdDC5QpOaaW2JkrQpfJ
R4OjRrr5eCATcMBn2sIBngXg46XFrOPz1S9wop3OeIHO1Xnz2W3STZcOMrhCFboE
R8YDwlNPyHwTsVhoDItUSpVlXgfXXwODGsgeTrnzoKuc8c4KTD2hsvoJDJbT1L8z
4wFFmypoMNdeDOTjCjuiyfdnGP4WX3+jHsdlQ8Vp2RxWG5Jxlxa/gvTraX17yigt
NKRdWlVMYauGRZ+Gxqwafs8y/z/CnlW0ZC6i+VLz78uFrwjHU/ETY3r9wtAvJDb4
VP927Xtr7WupVBV2//o2AUxmuGusr5i4MQ1hNICRUOvxYFnNDRonWyBhrJQpjmow
U+ha0+6nVqhF0X0W7lHfrbjfz0/XjYRJDEfrFSf2MDp27L1aHgBUzEshQLx0JCv9
lHWlO50J6ETNXVeLWSpMLjMTfatrdV+Sq6MdKctTXDs9CZ2deHLTlQ5uyIMSA725
iiGCGZ1orNsd54msMl2K
=PQjW
-----END PGP SIGNATURE-----

--vjvPeIPvmlhKGhFqOg4wpwU6wFjzugN23--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1c7139bd-258c-e7d2-2572-052da3803b3b>