Subject: Re: problems with disklabel
To: Graham Jenkins <c714553@vus415.telstra.com.au>
From: Thilo Manske <Thilo.Manske@HEH.Uni-Oldenburg.DE>
List: port-i386
Date: 09/15/1999 05:16:12
On Wed, Sep 15, 1999 at 12:30:24PM +1000, Graham Jenkins wrote:
> Yes - I had some similar problems. I inherited a 13Gb disk which had been
> used in a Linux/DOS machine, and tried to mount it as an additional '/data'
> filesystem.  'disklabel' eventually enabled me to do this - but refused to
> write the new partition table to disk.
> 
> So any pointers on how to force it to write a new label would be welcome.
Write the (automagically generated) disklabel into a file,
edit that file and write it back to the disklabel on the harddisk:

disklabel disk > tempfile
vi tempfile
disklabel -R [-r] disk tempfile
(don't use -r on some platforms, see disklabel(8)

This is the only way I can manage to put a new disklabel onto a "fresh"
hardisk.

[...]

IMHO it's very annoying behaviour from disklabel(8) to let someone edit
a disklabel but later refuse to write it to the disk and print out a not
very helpful error message(*), wich is what happens if someone tries to
create a new disklabel with "disklabel -e [-r] disk" 
(I guess this is what you did...)


(*) here is what I mean:

(first create "testdisk" to play with)

dd if=/dev/zero of=testdisk bs=1024 count=1024
vnconfig /dev/vnd0 testdisk

disklabel -e /dev/vnd0
(edit, edit, edit then quit)

disklabel: ioctl DIOCWDINFO: No disk label on disk;
use "disklabel -r" to install initial label

(Ok)

disklabel -e -r /dev/vnd0
disklabel: no disk label

:-)
-- 
Dies ist Thilos Unix Signature! Viel Spass damit.