Solved Unsetting active flag

I can't mount a partition on a FAT devise because the active flag is set.

How do I unset it?

I'm guessing that I can subsequently reset it by:-

gpart set -a active -i 1 da0
 
Is it already mounted somewhere?
It's a USB stick with FreeDOS on it.

When I tried to mount it I said operation not permitted. gpart showed the partition as active and after some searching I found that this was preventing it from being read.
 
Preventing Boot Errors: If you have multiple partitions, having more than one marked as "active" can confuse the BIOS/UEFI, leading to boot errors.
Active Partition: The BIOS/UEFI looks for boot files on the partition marked "active".
 
Preventing Boot Errors: If you have multiple partitions, having more than one marked as "active" can confuse the BIOS/UEFI, leading to boot errors.
Active Partition: The BIOS/UEFI looks for boot files on the partition marked "active".
I want to unset the partition marked active.
 
gpart (un)set -a active -i indeX diskX
root@W520:~ # gpart show da0
=> 63 15761441 da0 MBR (7.5G)
63 15761441 1 fat32 [active] (7.5G)

Many thanks. This worked.

gpart unset -i 1 -a active da0

root@W520:~ # gpart show da0
=> 63 15761441 da0 MBR (7.5G)
63 15761441 1 fat32 (7.5G)

I never noticed the UNSET command.

Here is what ChatGPT suggested:-

gpart modify -i 1 -a off da0
 
The active flag has nothing to do with being able to mount it or not.
All I can say is that I had errors saying I couldn't mount a partition when a partition was set active.

I asked ChatGPT:-

freebsd mounting active fat partition not permitted

I don't how to quote the response, but followed the suggestion to unset the active flag and it worked. Actually the command line provided wasn't quite right, but when corrected it cleared the flag and I was able to mount the partition.

I do have another USB stick which also has a partition marked active but I had no problems mounting it. I'm just reporting my experience.
 
You asked ChatGPT a leading question. And perhaps asking ChatGPT anything at all was already a mistake.

but when corrected it cleared the flag and I was able to mount the partition.
post hoc, ergo propter hoc

I do have another USB stick which also has a partition marked active but I had no problems mounting it. I'm just reporting my experience.
So, the active flag had nothing to do with it.
 
You asked ChatGPT a leading question. And perhaps asking ChatGPT anything at all was already a mistake.
All I can say is that an explanation was provided for me not being able to mount a partition. The explanation led me to a solution.
 
FAT: didn't the active flag indicate "boot from me"? I'm trying to go way back in the dusty halls of memories long forgotten with that. Kind of like the MBR stuff. "4 primary partitions, extended partitions in a primary..."
 
didn't the active flag indicate "boot from me"?
If I recall correctly it's what the code in the master boot record looks for. And where it gets stage 2 of the boot process from.
 
  • Like
Reactions: mer
Back
Top