Re: Wear levelling on micro-sd cards

2022-12-29 Thread hede
On 27.12.2022 10:12 Tixy wrote: You probably can't. I've not heard of removable cards supporting the 'trim' command. I'm running Debian on some Lenovo Flex 3 Chromebook here, booting from SD-Card in the internal SD Slot. And fstrim is working fine on a Sandisk High Endurance (one of the

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Matthias Böttcher
> How do I tell the card that the free space in the VG really is free? blkdiscard

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Tixy
On Tue, 2022-12-27 at 13:47 +, Tim Woodall wrote: > On Tue, 27 Dec 2022, Tixy wrote: > > > On Mon, 2022-12-26 at 21:37 +, Tim Woodall wrote: > > > > > > > But now I'm concerned about disks in a raid-1. Everything gets written > > > when the raid rebuilds. > > > > > > I've found fstrim -

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Tim Woodall
On Tue, 27 Dec 2022, Tixy wrote: On Mon, 2022-12-26 at 21:37 +, Tim Woodall wrote: But now I'm concerned about disks in a raid-1. Everything gets written when the raid rebuilds. I've found fstrim - but that only seems to be for filesystems. How do I tell the card that the free space in

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Tixy
On Tue, 2022-12-27 at 11:31 +0100, Nicolas George wrote: > Tixy (12022-12-27): > > The card could know what blocks of flash have been written to, it's the > > thing that has done the writing. > > Indeed. And as I said already, unless the card is pathologically > underused You said 'unless the

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Nicolas George
to...@tuxteam.de (12022-12-27): > For flash media, most of the time, "pathologically underused" is in my > view "recommended state". My back-up USB stick is less than 50%. Once > it reaches significantly more than that, I look around for one with four > times that capacity. Good for you. But

Re: Wear levelling on micro-sd cards

2022-12-27 Thread tomas
On Tue, Dec 27, 2022 at 11:31:19AM +0100, Nicolas George wrote: [...] > Pathologically underused. A more typical use of a card would be “damn, > my camera/phone/recorder tells me the card is full, I need to copy a few > things to the cloud”. For flash media, most of the time, "pathologically

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Nicolas George
Tixy (12022-12-27): > The card could know what blocks of flash have been written to, it's the > thing that has done the writing. Indeed. And as I said already, unless the card is pathologically underused, “what blocks of flash have been written to” eventually becomes “all of them”. So you have

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Tixy
On Mon, 2022-12-26 at 21:26 +0100, Nicolas George wrote: > Tixy (12022-12-26): > > He didn't mention filesystems. > > > > The controller in the card would surely know what flash blocks contain > > data, so writing the whole card first would reserve those blocks as > > 'in-use' leaving just a

Re: Wear levelling on micro-sd cards

2022-12-27 Thread Tixy
On Mon, 2022-12-26 at 21:37 +, Tim Woodall wrote: > > > But now I'm concerned about disks in a raid-1. Everything gets written > when the raid rebuilds. > > I've found fstrim - but that only seems to be for filesystems. > > How do I tell the card that the free space in the VG really is

Re: Wear levelling on micro-sd cards

2022-12-26 Thread tomas
On Mon, Dec 26, 2022 at 09:26:58PM +0100, Nicolas George wrote: > Tixy (12022-12-26): > > He didn't mention filesystems. > > > > The controller in the card would surely know what flash blocks contain > > data, so writing the whole card first would reserve those blocks as > > 'in-use' leaving just

Re: Wear levelling on micro-sd cards

2022-12-26 Thread John Conover
Stefan Monnier writes: > > To test, say with a 16 GB SD, fill the SD to all except the last 1 KB, > > and with a looping script, write 1KB of 1's to the remainder of the > > SD, erase the "bits," then 1KB of 0's, erase the "bits", and so on; > > I'm surprised. I would have expected uSD cards,

Re: Wear levelling on micro-sd cards

2022-12-26 Thread Stefan Monnier
> To test, say with a 16 GB SD, fill the SD to all except the last 1 KB, > and with a looping script, write 1KB of 1's to the remainder of the > SD, erase the "bits," then 1KB of 0's, erase the "bits", and so on; I'm surprised. I would have expected uSD cards, just like SSDs to rely mostly on a

Re: Wear levelling on micro-sd cards

2022-12-26 Thread Tim Woodall
On Mon, 26 Dec 2022, Tixy wrote: On Mon, 2022-12-26 at 20:46 +0100, Nicolas George wrote: John Conover (12022-12-26): So, the more unused SD space is better, since wear leveling writes to a "bit" that has been written to fewer times. To test, say with a 16 GB SD, fill the SD to all except

Re: Wear levelling on micro-sd cards

2022-12-26 Thread gene heskett
On 12/26/22 13:44, Jeffrey Walton wrote: On Mon, Dec 26, 2022 at 1:25 PM Tim Woodall wrote: [...] It had a 16GB sandisk microSD card although I was only using c 3GB at the beginning. On 21st December the kernel remounted the card ro - but (almost) everything continued to work - my daily

Re: Wear levelling on micro-sd cards

2022-12-26 Thread Nicolas George
Tixy (12022-12-26): > He didn't mention filesystems. > > The controller in the card would surely know what flash blocks contain > data, so writing the whole card first would reserve those blocks as > 'in-use' leaving just a relatively small amount of spare blocks which > would be available for

Re: Wear levelling on micro-sd cards

2022-12-26 Thread John Conover
Nicolas George writes: > John Conover (12022-12-26): > > So, the more unused SD space is better, since wear leveling writes to > > a "bit" that has been written to fewer times. > > > > To test, say with a 16 GB SD, fill the SD to all except the last 1 KB, > > and with a looping script, write 1KB

Re: Wear levelling on micro-sd cards

2022-12-26 Thread debian-user
> John Conover (12022-12-26): > > So, the more unused SD space is better, since wear leveling writes > > to a "bit" that has been written to fewer times. > > > > To test, say with a 16 GB SD, fill the SD to all except the last 1 > > KB, and with a looping script, write 1KB of 1's to the remainder

Re: Wear levelling on micro-sd cards

2022-12-26 Thread Tixy
On Mon, 2022-12-26 at 20:46 +0100, Nicolas George wrote: > John Conover (12022-12-26): > > So, the more unused SD space is better, since wear leveling writes to > > a "bit" that has been written to fewer times. > > > > To test, say with a 16 GB SD, fill the SD to all except the last 1 KB, > > and

Re: Wear levelling on micro-sd cards

2022-12-26 Thread Nicolas George
John Conover (12022-12-26): > So, the more unused SD space is better, since wear leveling writes to > a "bit" that has been written to fewer times. > > To test, say with a 16 GB SD, fill the SD to all except the last 1 KB, > and with a looping script, write 1KB of 1's to the remainder of the >

Re: Wear levelling on micro-sd cards

2022-12-26 Thread John Conover
Tim Woodall writes: > > Do these cards have wear levelling? Have I just got unlucky that it's > the start of the card that is unwriteable and so I cannot continue on > the 12GB of space that has never been part of a partition? > Almost all SD cards from the major manufacturers in the last 5

Re: Wear levelling on micro-sd cards

2022-12-26 Thread Jeffrey Walton
On Mon, Dec 26, 2022 at 1:25 PM Tim Woodall wrote: > > [...] > > It had a 16GB sandisk microSD card although I was only using c 3GB at > the beginning. > > On 21st December the kernel remounted the card ro - but (almost) > everything continued to work - my daily backups take a snapshot (which >