Solved Ridiculous Question about msdosfs

Phishfry

Son of Beastie

Reaction score: 1,396
Messages: 4,113

Been meaning ask to this question as I need to fill in my knowledge banks.
I know that UEFI and Arm/Uboot uses a FAT boot partition.
Can FreeBSD reside on an all msdosfs filesystem or is UFS/ZFS required?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,672
Messages: 30,574

As far as I know UFS and ZFS are the only two filesystems FreeBSD is capable of booting from.
 

Vull

Well-Known Member

Reaction score: 119
Messages: 285

I don't believe so. Someone please correct me if I'm mistaken about any of this, but the FAT boot partition you're referring to is not the same thing as the partition upon which the /boot directory is mounted. Rather, it's just a small partition, usually about 512 KB in size, which the BIOS or UEFI firmware uses as a workspace during the boot process. When I create these partitions during my BIOS installations, I specify the type of this partition as "freebsd-boot" rather than as "freebsd-ufs" or as "freebsd-swap" which are the only other types I use regularly. It's been too long since I did a UEFI installation but there the partition type might have been specified as EFI like it is on Linux systems... I just can't remember what it was called.

The partition type of the /boot directory must be a journalized unix filesystem type like ufs, zfs, or ext which supports unix-style user and group ownerships, and permission bits. FAT file system types don't support ownership or permissions for individual files and directories. When you mount an msdosfs drive under FreeBSD or other unixes, the system just sort of fakes the ownerships and permission bits, by copying the user and group ownership of the mount directory, and by pretending that the files and subdirectories under that directory all have the same ownerships as the mountpoint directory has, and by applying some sort of common permission scheme to all the files and directories under the mount point. Usually it's something like 755 for directories and 644 for flat files. Depends on the mounting software used, and on how it's configured.
 

Sensucht94

Well-Known Member

Reaction score: 401
Messages: 389

FAT for one doesn't support symlinks and file permissions, both good enough reasons to make FreeBSD have serious problem residing on it
 
OP
OP
Phishfry

Phishfry

Son of Beastie

Reaction score: 1,396
Messages: 4,113

Not that I would do it, it's just one of those nagging little questions I have had for a while.

I am learning NetApp switch OS which is FreeBSD based and it just got me thinking about scenarios..
 

Sensucht94

Well-Known Member

Reaction score: 401
Messages: 389

I don't believe so. Someone please correct me if I'm mistaken about any of this, but the FAT boot partition you're referring to is not the same thing as the partition upon which the /boot directory is mounted. Rather, it's just a small partition, usually about 512 KB in size, which the BIOS or UEFI firmware uses as a workspace during the boot process
To my knowledge freebsd-boot partition is only used by gptboot(8) in case of a GPT/MBR layout. On UEFI, as opposite to Linux bootloaders, ESP is never mounted by default at /boot, rather, /EFI/BOOT/BOOTX64.EFI on the ESP (default UEFI firmware instruction set location, which, if created using gpart, is a copy of the /boot/boot1.efi bootstrap code found on root), displays the FreeBSD bootloader screen on stage 2 by reading /boot.config and instructs UEFI to load loader(8) from the first freebsd-ufs or freebsd-zfs partition it founds.

The /boot/boot1.efifat is a compressed image of ESP residing on root, which provides the UEFI bootstrap code for 'gpart bootcode' to use.

ESP can be FAT12 or FAT16 too
 

Sensucht94

Well-Known Member

Reaction score: 401
Messages: 389

NetBSD does the exact same thing, the only differences being that the ESP image resides at /usr/mdec and bootloader config at /boot.cfg, while no loader exists and kernel, residing by default at /netbsd on the first FFS partition, is loaded directly and mounted on volatile memory as a pseudo-fs at /kernfs
 
OP
OP
Phishfry

Phishfry

Son of Beastie

Reaction score: 1,396
Messages: 4,113

Three no's is enough for me. I will mark this solved. Anyone care to refute this conclusion feel free to jump in.
Thank You all for not bashing me. I was surprised to see FAT in use when I converted over to FreeBSD.

I wish I could boot off a FreeBSD usb stick and interrogate this NetApp hardware.
It is Arm based and no SD Card.
 

Sensucht94

Well-Known Member

Reaction score: 401
Messages: 389

Three no's is enough for me. I will mark this solved. Anyone care to refute this conclusion feel free to jump in.
Thank You all for not bashing me. I was suprised to see FAT in use when I converted over to FreeBSD.
If you want to port FreeBSD to any new filesystem, like HAMMER2 or NetBSD's CHFS (to use as a BSD F2FS replacement for SDs/CFs on embedded boards) you have all my support and encouragement :cool:


Regarding FAT, I think the absence of any journaling or SU capabilities, the tendency fragmentation, the 4KB superblock sector size would be other reasons to not use it =P
 
OP
OP
Phishfry

Phishfry

Son of Beastie

Reaction score: 1,396
Messages: 4,113

On Arm the dtb's are symbolic linked although you can use /boot/loader.conf to point to them.
 
Top