Can't use disklabel to find the real size of a disk since a fake disklabel
read from disk is trusted. Revert to use drvctl again.
This commit is contained in:
parent
8b539d7c36
commit
5d501e0c8a
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $NetBSD: resize_disklabel,v 1.4 2023/02/18 07:58:34 mlelstv Exp $
|
||||
# $NetBSD: resize_disklabel,v 1.5 2023/03/18 11:36:23 mlelstv Exp $
|
||||
#
|
||||
|
||||
# PROVIDE: resize_disklabel
|
||||
|
@ -27,8 +27,7 @@ get_total_sectors()
|
|||
local disk
|
||||
|
||||
disk=$1
|
||||
/sbin/disklabel -t "$disk" \
|
||||
| sed -ne 's/.*:su#\([0-9]*\):.*/\1/p'
|
||||
/sbin/drvctl -p "$disk" disk-info/geometry/sectors-per-unit
|
||||
}
|
||||
|
||||
get_rawpart_sectors()
|
||||
|
|
Loading…
Reference in New Issue