Subject: Re: Pain about disklabel
To: Markus Illenseer Markus <markus@server.peacock.de>
From: Curt Sampson <curt@portal.ca>
List: port-i386
Date: 01/11/1996 23:43:06
On Fri, 12 Jan 1996, Markus Illenseer Markus wrote:
> Ok, here is my error again: All i did was inserting a fresh, new and virgin
> hard drive (SCSI) into my sytem, already running NetBSD on another drive.
>
> Booting and starting disklabel -e sd1 was what I did then. Creating partitions
> and then saving resulted into sort of error, but the disklabel was "written".
>
> All options for disklabel resulted into this error:
>
> disklabel: warning, DOS partition table with no valid NetBSD partition
> disklabel: no disk label
>
> Nontheless, the label was written and usuable - until next boot, where
> everything vanished. I was able to "resurect" the drive, because I luckily
> wrote the output of disklabel to a file and using this reanimated the
> drives.
Ah, you're using the -e option. Take a look at the -r option and note
carefully what it does. It looks to me as if when you use -e and not -r,
the label in memory is changed, but not the one on disk. Of course, if
you use -e and -r together, you'll be editing bogus data, rather than
the fake label created for the disk with no label.
I generally do the following with a new disk sd1:
disklabel sd1 >protfile
vi protfile
[ make appropriate changes and write it out ]
disklabel -r -R sd1 protfile
I really, really recommend keeping a copy of every disklabel you
ever make in an appropriately named file in /etc/disklabels or
wherever on some machine anyway. It gives you a better starting
point when you have to go at another disk of the same type, and it
gives you an easy backup should a disk get wiped and you have to
restore from a full backup.
cjs
Curt Sampson curt@portal.ca Info at http://www.portal.ca/
Internet Portal Services, Inc.
Vancouver, BC (604) 257-9400 De gustibus, aut bene aut nihil.