NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/56300: gpt useless on gpt labels extending beyond disk size (also affects sysinst)



>Number:         56300
>Category:       bin
>Synopsis:       gpt useless on gpt labels extending beyond disk size (also affects sysinst)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 06 10:55:00 +0000 2021
>Originator:     kardel%netbsd.org@localhost
>Release:        NetBSD 9.99.85
>Organization:
	
>Environment:
	
	
System: NetBSD kebne-new 9.99.85 NetBSD 9.99.85 (GENERIC) #4: Tue Jun 29 11:47:28 CEST 2021 kardel@pip:/src/NetBSD/cur/src/obj.amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	gpt becomes useless when it hits a gpt label that extends beyond the size of
	the disk. This can be caused by e. g. changing a physical disk with gpt label
	to a virtual disk in a RAID controller. The label stays the same but the size
	decreases (e. g. Dell PERC controllers). After that gpt cannot manipulate the
	label at all due to a hard consistency check. Suppressing error messages 
	also do not prevent the exit at this error message

# gpt show sd2
gpt: /dev/rsd2: map entry doesn't fit media: new start + new size < start + size
(22 + 37d3ffde < 800 + 37e42800)
# gpt destroy sd2
gpt: /dev/rsd2: map entry doesn't fit media: new start + new size < start + size
(22 + 37d3ffde < 800 + 37e42800)
# gpt header sd2
gpt: /dev/rsd2: map entry doesn't fit media: new start + new size < start + size
(22 + 37d3ffde < 800 + 37e42800)

	As sysinst uses also gpt it cannot properly handle diskes wih these labels.
	The kernel does not seem to be that strict and uses the data from the label.

	The workaround is to zap the gpt label with the classic dd method.

	gpt should at least allow destroying these labels. Ideally it should accept
	the label, but refuse to write an inconsistent label. This would allow fixing
	the labels and allow to retain data except for the missing space.

>How-To-Repeat:
	Convert a physical disk on a Dell RAID Controller with a valid gpt label to
	a virtual disk (thus reducing the size but not altering the gpt label).
	Attempt to use that disk with NetBSD and see gpt failing.
>Fix:
	make gpt accept these labels but refuse to write inconsistent labels

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index