newfs(1) on a file

Nazim Can Bedir nzmjx at protonmail.com
Thu Jun 4 17:04:41 UTC 2020


Or,

The normal file I/O and device I/O call and code paths in the kernel are 
different. And, in order to include efficient and proper caching of disk 
blocks into the equation, damn filesystem backing stores need to be 
exist as devices. And, contrary to common belief, FreeBSD kernel 
developers may not be smart enough as you because they followed the sane 
approach: if mount command couldn't mount a GAY filesystem from the file 
as-is, then newfs(8) command shouldn't allow to create filesystem on 
file as-is (otherwise, idiot FreeBSD users like me could think that 
"aah, if newfs initialises filesystem on file without md, then it must 
be able to mount without md).

I really don't understand what is the damn problem here? Filesystem 
operations are performed on special files (a.k.a disks); and md kernel 
driver does exist for that purpose.

On 04/06/2020 19:39, goatshit54108 at national.shitposting.agency wrote:
> Running newfs(1) on a regular file bumps into some GAY issues:
>
> $ dd status=none if=/dev/zero bs=1m count=4 of=shit
> $ newfs ./shit
> newfs: ./shit: not a character-special device: No error: 0
> newfs: no valid label found
>
> The message is not clear, but it happens to be a cry for a BSD label. OK, first creating a BSD label does allow newfs to succeed:
> $ bsdlabel -wf ./shit
> $ newfs ./shit
> newfs: ./shit: not a character-special device: No error: 0
> ... (creation OK)
>
> The bump is inside getdisklabel(). Patching out the one and only call to getdisklabel() seems to avoid the issue without negative consequences:
> 	...
> 	lp = NULL; //lp = getdisklabel(); // GAY
> 	...
>
> $ dd status=none if=/dev/zero bs=1m count=4 of=shit
> $ non-gay_newfs ./shit
> newfs: ./shit: not a character-special device: No error: 0
> preposterous size 0
> $ non-gay_newfs -s $(((4 << 20) / 512)) ./shit
> newfs: ./shit: not a character-special device: No error: 0
> ... (creation OK)
>
> The inconvenient alternative, to get newfs to format the file though a memory disk, appears to create an identical file:
> $ dd status=none if=/dev/zero bs=1m count=4 of=shit
> $ su root
> ... (GAY) ...
> # mdconfig -a -t vnode -f ./shit -u 9
> # newfs /dev/md9
> ... (creation OK) ...
>
> Identical, that is, if we use `newfs -R` and discount a couple of reproducibility bugs/issues (<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246983>, <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246985>).
>
> Also, at a glance, using the BSD label method yields nothing other than a UFS filesystem along with a BSD label.
>
> So this code appears to be old garbage.
>
> Furthermore, the "not a character-special device" warning is just GAY without any benefit.
>
> Or?...
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"



More information about the freebsd-fs mailing list