-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mkfs.f2fs should reset zone pointers on zoned devices #13
Comments
Interesting. In f2fs-tools, I see f2fs_reset_zones() which
calls ioctl(dev->fd, BLKRESETZONE, &range);
Could you please check if your build is calling that path?
2021년 6월 2일 (수) 오전 9:42, Josh Carter ***@***.***>님이 작성:
… I have discovered (the hard way of course) that mkfs.f2fs -m does not
reset zone pointers on a SMR disk. This leads to unaligned write errors
once the file system hits one of those zones. I believe mkfs should reset
the write pointers of any sequential zones when the -m option is used.
If you have a drive that has been use before (some zone WP's not zero):
1. blkzone report /dev/device | grep "(fu)" | wc -l # note number of
full zones
2. mkfs.f2fs -m /dev/device
3. `blkzone report /dev/device | grep "(fu)" | wc -l' # same number of
full zones!
The worst part is that, depending on where the full zones are, the file
system may work fine for some amount of time before you hit a
previously-used zone. I have also noticed that fsck.f2fs doesn't fix this
problem, despite patches that indicate it should. I've built and installed
the latest f2fs-tools from source. I am running on Ubuntu 20.04 LTS, kernel
5.4.0-73-generic.
The work-around is to make sure you run blkzone reset /dev/device before
creating the file system.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#13>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4EPAQP72C3Y5Y4UL2PXO3TQZNQ5ANCNFSM457DJWYA>
.
|
Yes, certainly, I will investigate and report back. |
The issue appears to be that I'm formatting a partition of the device, and I tried this using What's the correct solution here? Should Thanks for your assistance, I appreciate it! |
Follow-up to my note about the checks in For that scenario, perhaps it's best to check if the device name is a symlink, and follow the symlink if so. On my Ubuntu 20.04 system, Is there another way to get the zone topology than reading files under |
I have discovered (the hard way of course) that
mkfs.f2fs -m
does not reset zone pointers on a SMR disk. This leads to unaligned write errors once the file system hits one of those zones. I believe mkfs should reset the write pointers of any sequential zones when the-m
option is used.If you have a drive that has been use before (some zone WP's not zero), in this example
/dev/sdb1
is a 16TiB partition of a large host-managed SMR drive:blkzone report /dev/sdb1 | grep "(fu)" | wc -l
# note number of full zonesmkfs.f2fs -m /dev/sdb1
blkzone report /dev/sdb1 | grep "(fu)" | wc -l
# same number of full zones!The worst part is that, depending on where the full zones are, the file system may work fine for some amount of time before you hit a previously-used zone. I have also noticed that
fsck.f2fs
doesn't fix this problem, despite patches that indicate it should. I've built and installed the latest f2fs-tools from source. I am running on Ubuntu 20.04 LTS, kernel 5.4.0-73-generic.The work-around is to make sure you run
blkzone reset /dev/sdb1
before creating the file system.The text was updated successfully, but these errors were encountered: