Subject: Resizing netbsd disk partition
To: None <netbsd-users@NetBSD.org>
From: Anzi <anzi@dnainternet.net>
List: netbsd-users
Date: 01/15/2007 15:03:58
Hello all

I have a netbsd 3.1 machine running some xen stuff. Unfortunately I made 
the original disk partitioning poorly and disk is running out. The 
question is how can (if possible)  I resize the netbsd partion (grow 
netbsd partition at the end of disk) without reinstalling everything?

Or is there a way to access partions outside the netbsd partition 
(disklabel)?



disklabel is:

-bash-2.05b# disklabel wd0
# /dev/rwd0d:
type: unknown
disk: IBM-61
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 119150
total sectors: 120103200
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:  38343312        63     4.2BSD   2048 16384     0  # (Cyl.      0*-  
38039*)
 b:   2622375  38343375       swap                     # (Cyl.  38039*-  
40640*)
 c:  40965687        63     unused      0     0        # (Cyl.      0*-  
40640*)
 d: 120103200         0     unused      0     0        # (Cyl.      0 - 
119149)

FDISK shows:

-bash-2.05b# fdisk
Disk: /dev/rwd0d
NetBSD disklabel disk geometry:
cylinders: 119150, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 120103200

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 120103200

Partition table:
0: NetBSD (sysid 169)
    start 63, size 40965687 (20003 MB, Cyls 0-2550), Active
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector disabled.