Block size revisited

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
daveyw
Posts: 252
Joined: Mon Sep 12, 2011 7:44 pm

Block size revisited

Post by daveyw »

If there's one question that keeps getting asked it's, "what blocksize should I use [with SFS02]?"

I've always used 512, but I found this PDF on the 4.1 FE CD:

"Of course, on SSDs and modern harddisks with 4KiB native block size, you should nevertheless use a 4KiB block size".

So, for modern drives and SSDs I should use a block size of 4096?
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Block size revisited

Post by tonyw »

Yes you should, and the 4 KiB blocks should also be aligned to 4 kiB boundaries. The risk is shorter life for the SSD, but it won't cause any bad effects on an HDD.

Some of our lower-level components are being updated to support these requirements, but it will take a while before it's all automatic, so best help things along by forcing 4 KiB yourself.

If I understand it correctly, SFS does not perform at its best with block sizes greater than 512 B, so there may be a performance penalty. I think FFS performs better with blocks larger than 512 B.
cheers
tony
User avatar
daveyw
Posts: 252
Joined: Mon Sep 12, 2011 7:44 pm

Re: Block size revisited

Post by daveyw »

Thanks, good to know. I have experienced *endless* problems with HDDs (both PATA and SATA) I have bought over the past 5 years. One of my partitions is now effectively read-only.

When I build my X5000, I'll start from scratch with a new SSD I bought last month. Fingers crosses...
Gregor
Posts: 103
Joined: Thu Sep 08, 2011 10:44 am

Re: Block size revisited

Post by Gregor »

daveyw wrote:Thanks, good to know. I have experienced *endless* problems with HDDs (both PATA and SATA) I have bought over the past 5 years. One of my partitions is now effectively read-only.

When I build my X5000, I'll start from scratch with a new SSD I bought last month. Fingers crosses...
Did you have all these problems with Amiga/AmigaOS, or also with other systems?

As discussed here earlier, AmigaOS does not (and will not) have TRIM support. For that reason, you should choose a SSD which has been designed to work properly without it! OWC is one of those, as it was originally made for Macs in those times MacOS did not have Trim support. The US distributor of X5000 has wisely chosen that for their machines - I hope the European dealers will do the same!

In contrast, most of the popular SSD brands (Kingston, Samsung etc.) are designed to be used with TRIM, and the manufacturers recommend against using them without it. I would not accept a X5000 bundle having one of those...

Regards,

Gregor
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Block size revisited

Post by tonyw »

AmigaOS does not (and will not) have TRIM support.
I think you're being a mite pessimistic. Although it will take some enhancement of the device drivers, modern file systems will be capable of supplying TRIM data to the device driver so that it can tell an SSD which blocks are free.

Admittedly there is no prospect of legacy file systems being upgraded.
cheers
tony
User avatar
daveyw
Posts: 252
Joined: Mon Sep 12, 2011 7:44 pm

Re: Block size revisited

Post by daveyw »

Gregor wrote:Did you have all these problems with Amiga/AmigaOS, or also with other systems?
Amiga OS4 A1-XE. I don't really use any other system.
User avatar
daveyw
Posts: 252
Joined: Mon Sep 12, 2011 7:44 pm

Re: Block size revisited

Post by daveyw »

tonyw wrote:the 4 KiB blocks should also be aligned to 4 kiB boundaries.
Can you elaborate on what this means?
User avatar
Raziel
Posts: 1171
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Block size revisited

Post by Raziel »

@daveyw

You may need a bit more work on preparing an SSD under AmigaOS4.
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Block size revisited

Post by tonyw »

daveyw wrote:
tonyw wrote:the 4 KiB blocks should also be aligned to 4 kiB boundaries.
Can you elaborate on what this means?
When I was investigating these requirements, I found a beautiful picture that was better than a thousand words, but I can't find it again. So I'll have to use a word picture instead:

The device (SSD, say) reports a sector size of 512 B, but we know (or assume) that it is really based on a block size of 4096 B (containing 8 x 512-B sectors).

Alignment just means that the second 4096-B block must start at the end of the first 8 sectors, in other words, on an address that is a multiple of 4096 B. If it were to start at address 1536 (start of the fourth sector), then a write to that 8-sector "block" would cause the drive controller to perform two read-erase-modify-write operations, one for the block spanning addresses 0 - 4095 and another for the block spanning 4096 - 8191.
cheers
tony
Gregor
Posts: 103
Joined: Thu Sep 08, 2011 10:44 am

Re: Block size revisited

Post by Gregor »

tonyw wrote:
AmigaOS does not (and will not) have TRIM support.
I think you're being a mite pessimistic. Although it will take some enhancement of the device drivers, modern file systems will be capable of supplying TRIM data to the device driver so that it can tell an SSD which blocks are free.

Admittedly there is no prospect of legacy file systems being upgraded.
Pessismistic, me...?-) I am only referring to what S. Solie said earlier about this business:

"I don't see any point in spending effort on an outgoing feature. I think all future drives will take care of this (as they always should have) themselves."

Regards,

Gregor
Post Reply