Conversation
NVMe's are formatted to 512B sector size, and most of them have option to be formatted to 4096. And it works. I'm amazed.
1
0
2

@kdave I'm still surprised my Samsung SSD 990 PRO 2TB can't do it despite being not that old.

1
0
0

Vlastimil Babka 🇨🇿🇪🇺🇺🇦

@oleksandr @kdave how is that done if supported?

1
0
0
@oleksandr @vbabka Yes, basically two commands: nvme ns-id -H /dev/nvmeX (check the profiles) and nvme format --lbaf=1 /dev/nvmeX to change it. Obviously, it destroys the data.
1
0
2

Vlastimil Babka 🇨🇿🇪🇺🇺🇦

@kdave @oleksandr hm so my recently bought WD BLACK SN770 has the 4k option, wish I knew this when I started to use it lol

1
0
0

@vbabka What are reliably working models then?

@kdave

1
0
0
@vbabka @oleksandr Probably a firmware bug, that do exist and happen on all devices / vendors and are unfortunatelly not that rare.
0
0
1
@oleksandr @vbabka My sample is too small to tell, I have converted Kingston drives, one of them is backing drives for testing VMs, so I'll know when it fails.
1
1
1
@oleksandr @vbabka And I have the first victim, Verbatim Vi3000, system does not boot, device is visible in BIOS.
1
1
2
@oleksandr @vbabka So, it's not that simple.

What I did:
1. dd device to file
2. format NVMe to 4096 bytes/sector
3. dd file to device
4. no partitions detected
5. reboot, stuck in BIOS

Attempt to copy parition table from file to device using sfdisk showed errors and sector size of 4096, GPT table wrong number of sectors etc.

In the log there was line like "inconsistent atomic write size, namespace will not be added subsystem=4096bytes controller/namespace=512 bytes".

Recovery:
1. boot rescue system
2. format NVMe back to 512 bytes/sector
3. dd file to device
4. partitions detected again
5. reboot, back to the system

I don't know what exactly went wrong, the sfdisk partition recreation worked fine with Kingston (KC3000). There are potential problems with partitions and some kind of mismatch what drive reports as sectors.
2
0
0
Edited 14 days ago

@kdave What if you backup/restore everything on a FS level instead of block level? With FS recreation and updating UUIDs where needed.

@vbabka

1
0
0

Vlastimil Babka 🇨🇿🇪🇺🇺🇦

@kdave @oleksandr right my thinking was I'd rather partition from scratch and dd only partition contents

1
0
0
@oleksandr @vbabka I don't know but I assume this works, fdisk would create partitions at the right places and filesystem uses logical disk address.
0
0
0
@vbabka @oleksandr one dd back and forth was easier on first sight. I can try again with manual partitioning though.
1
0
1

@kdave @oleksandr @vbabka Guys, when I listen to you, I'm glad I've been using LVM for decades. Add a PV (physical volume) to the system VG (volume group), migrate all data to the new PV (while actively using the system!), then remove the old PV, reformat the disk, and repeat in the other direction.
Since it needs no downtime, I'm going to give it a try on my primary system tomorrow.

2
0
0

Vlastimil Babka 🇨🇿🇪🇺🇺🇦

@ptesarik @kdave @oleksandr btrfs can migrate without LVM :)

1
0
0

@vbabka @kdave @oleksandr But can btrfs span two block devices with different sector sizes?

2
0
0

@vbabka @kdave @oleksandr Update: The NVMe drive in my newer work ThinkPad P14s does not support a 4K LBA Format. But the NVMe in my old ThinkPad E595 supports it! OK, I'll try it anyway, but it won't be my main workstation, sorry.

0
0
0

@ptesarik LVM is a permanent excuse for not having a proper in-kernel FS.

runs

@kdave @vbabka

1
0
0

@oleksandr @kdave @vbabka
What is a proper in-kernel FS anyway?
NTFS?
(hides)
ZFS?
(runs)

2
0
0

Vlastimil Babka 🇨🇿🇪🇺🇺🇦

1
0
0

@vbabka @oleksandr @kdave
You can't resist forcing your favourite MM-stuff down our throats, can you?
Fuck off and let us breathe!

1
1
0

@ptesarik …screams from a big distance… Reiser5

@kdave @vbabka

0
0
0

Vlastimil Babka 🇨🇿🇪🇺🇺🇦

1
0
0

@vbabka @oleksandr @kdave @axboe NOOOO!
What shall I do if I get a 1-month suspension from posting anything about bare feet???

0
0
0
@ptesarik @vbabka @oleksandr Sector sizes of block devices yes, because of block layer abstraction. Not on the filesystem level unless you want more OMG blatant layering violation.
0
0
2