Skip to content

Commit

Permalink
Can't use disklabel to find the real size of a disk since a fake disk…
Browse files Browse the repository at this point in the history
…label

read from disk is trusted. Revert to use drvctl again.
  • Loading branch information
mlelstv authored and mlelstv committed Mar 18, 2023
1 parent 27b46af commit 7a85a2f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions distrib/utils/embedded/files/resize_disklabel
@@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 7a85a2f

Please sign in to comment.