On Fri, Sep 14, 2012 at 5:19 PM, Yuri <y...@rawbw.com> wrote:
> I am trying to change the active partition in MBR.
> This should be a matter of changing only two bits (clearing one in one byte
> and setting another one in another byte).
>
> However, fdisk complains:
> fdisk: Failed to write MBR. Try to use gpart(8).
>
> truss reveals that fdisk failed to open the root disk for writing:
> open("/dev/ad4",O_RDWR,00)                       ERR#1 'Operation not
> permitted'
> open("/dev/ad4",O_RDONLY,00)                     = 3 (0x3)
> ...
> ...
> pwrite(0x3,0x34048200,0x200,0x0,0x0,0x0)         ERR#9 'Bad file descriptor'
> Failed to write MBR. Try to use gpart(8)
>
> The question is: why the disk can't be open RW under root?
> The secondary issue is the bug in fdisk: once -a option is supplied and it
> can't open it RW it should just say so, and not suggest using gpart because
> gpart will probably have the same issue.

1. What version of FreeBSD?
2. What do you have set for kern.geom.debug_flags?
3. Is /dev/ad4 (or any partitions / slices under it) currently in use?

Thanks!
-Garrett
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to