NetBSD-Bugs archive

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

bin/60208: 'gpt add' should error if the specified label already exists



>Number:         60208
>Category:       bin
>Synopsis:       'gpt add' should error if the specified label already exists
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 24 02:20:00 +0000 2026
>Originator:     Jan Schaumann
>Release:        NetBSD 10.1
>Organization:
	
>Environment:

NetBSD ip-10-10-0-58.ec2.internal 10.1 NetBSD 10.1 (GENERIC64) #0: Mon Dec 16 13:08:11 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm

Architecture: 
Machine: 
>Description:

When creating a new wedge, gpt(8) allows you to specify a label using the
'-l' command-line option.

If the label specified already exists, gpt(8) uses a default label without
giving the user any indication that the specified label was not used.

Instead, the program should throw an error and exit unsuccessfully.

>How-To-Repeat:

# dd if=/dev/zero of=my.img bs=102400000 count=15
# vndconfig vnd0 my.img
# gpt create vnd0

# gpt add -l label -s 10m vnd0
/dev/rvnd0: Partition 1 added: 49f48d5a-b10e-11dc-b99b-0019d1879648 34 20480
# gpt add -l label -s 10m vnd0
/dev/rvnd0: Partition 2 added: 49f48d5a-b10e-11dc-b99b-0019d1879648 20514 20480
# dkctl vnd0 listwedges
/dev/rvnd0: 2 wedges:
dk2: label, 20480 blocks at 34, type: ffs
dk3: 24353103-fd53-4bb6-8723-2d970fd33145, 20480 blocks at 20514, type: ffs

Note that both `gpt add` invocations succeeded and from the output it's
impossible to tell whether the specified label was used or not.  The user
would assume that since the command succeeded, it did exactly what was
asked.

Only /var/log/messages / dmesg show:

Apr 24 02:02:53 ip-10-10-0-58 /netbsd: [ 2362.9555455] dk3 at vnd0: "24353103-fd53d0: wedge named 'label' already existed, using '24353103-fd53-4bb6-8723-2d970fd33145'

>Fix:
	

>Unformatted:
 	
 	



Home | Main Index | Thread Index | Old Index