kern/145309: Editing disk label invalidates the whole device

Yar Tikhiy yar at FreeBSD.org
Sat Apr 3 01:30:07 UTC 2010


>Number:         145309
>Category:       kern
>Synopsis:       Editing disk label invalidates the whole device
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 03 01:30:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Yar Tikhiy
>Release:        8.0-RELEASE
>Organization:
NA
>Environment:
8.0-RELEASE GENERIC
>Description:
In single-user mode (with just / mounted r/o), any change to the label of the disk the root partition is residing on seems to immediately invalidate the device for the kernel.  E.g., after the partition was written out by bsdlabel(8), any access to the disk with fail with EIO or EXIO.

OTOH, in multi-user mode (i.e., with everything mounted r/w) editing the label is just impossible: bsdlabel will complain:
bsdlabel: Class not found
>How-To-Repeat:
Boot in single-user mode.
Create MFS /tmp so that the editor is happy: mdmfs -s10m md /tmp
Change the default editor: export EDITOR=ed
Start bsdlabel: bsdlabel -e ad0s1
Make a harmless change, e.g., create a new partition in the unused space at the end of the disk -- make sure there is some!
Save.
Run any command from / as nothing else is mounted, e.g., "ls /boot" or "reboot"
See the kernel croak:

vnode_pager_getpages: I/O read error
ls: Input/output error

or

reboot: Device not configured
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list