Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Sep 2015 10:53:18 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        "Brandon J. Wandersee" <brandon.wandersee@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Replacing Drive with SSD
Message-ID:  <alpine.BSF.2.20.1509061046320.41355@wonkity.com>
In-Reply-To: <8637yro6nu.fsf@WorkBox.Home>
References:  <CEAD84AD-341A-4FB9-A3A1-D0D5A550AFFD@lafn.org> <55E01DAE.1020709@infracaninophile.co.uk> <20150828084643.GB1274@xtaz.uk> <864mjj1fh3.fsf@WorkBox.Home> <alpine.BSF.2.20.1508281248500.74312@wonkity.com> <8637yro6nu.fsf@WorkBox.Home>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 6 Sep 2015, Brandon J. Wandersee wrote:

>
> Warren Block writes:
>
>> The SSD keeps a map of which blocks have been written.  So writing just
>> once with dd is not a wear problem.  The problem is that now the SSD has
>> no way of knowing whether that block has real data on it or not.  So it
>> can't swap it for wear leveling.  That's what trim does--when a file is
>> deleted, the filesystem uses trim to notify the SSD that those blocks
>> are no longer in use.
>
> Would this also apply to a *single file* written using dd? Your SSD
> guide recommends creating a swap file from /dev/zero using dd:
>
>> Because the data goes through the file system, TRIM will be used, and
>> the swap file can be resized without repartitioning the SSD.
>
> So is the problem with dd and SSDs only relevant when targeting a whole
> block device?

Yes.  Well, really it is about writing with methods that do not track 
whether a block is in use.  When that swap file is deleted, UFS tells 
the SSD that all those blocks are no longer in use.  dd(1) does not even 
have the concept of blocks being used or not, it just copies data.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1509061046320.41355>