Project

General

Profile

Actions

Bug #16371

open

mkfs.pcfs only supports 512B blocksize

Added by Patrick Mooney 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
filesystems (not ZFS)
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

When attempting to install illumos on a 4k-blocksize device, the UEFI bootrom (OVMF in this case) was unable to successfully locate a filesystem on the EFI partition during boot. Booting a Linux live image and attempting a fsck.fat yields an error about a zeroed sector size field. Investigation of the logic used by mkfs.pcfs shows us the issue:

static
int
open_and_seek(char *dn, bpb_t *wbpb, off64_t *seekto)
{
        struct fd_char fdchar;
        struct dk_geom dg;
        char *actualdisk = NULL;
        char *suffix = NULL;
        int fd;

        if (Verbose)
                (void) printf(gettext("Opening destination device/file.\n"));

        /*
         * We hold these truths to be self evident, all BPBs we create
         * will have these values in these fields.
         */
        wbpb->bpb.num_fats = 2;
        wbpb->bpb.bytes_sector = BPSEC;

Where BPSEC is defined as:

#define BPSEC           512     /* Assumed # of bytes per sector */

This hard-coded sector size will not work on devices which bear a block/LBA size != 512 bytes. I did confirm that a FAT filesystem created on such a device (under Linux, using dosfstools) is still able to be mounted by our pcfs driver, so at least the kernel side is working in that instance.

No data to display

Actions

Also available in: Atom PDF