Welcome to the most active Linux Forum on the web.
Go Back > Forums > Other *NIX Forums > *BSD
User Name
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.


  Search this Thread
Old 12-03-2004, 05:51 PM   #1
Registered: Apr 2004
Posts: 40

Rep: Reputation: 15
A bug? Disklabel problem

I have a little script that sets up a freebsd box:
umount /dev/ad0*
dd if=/dev/zero of=/dev/ad0 bs=1k count=1
fdisk -BI /dev/ad0
disklabel -R ad0 /home/mylabel
newfs /dev/ad0s1a
newfs /dev/ad0s1e
newfs /dev/ad0s1f
newfs /dev/ad0s1g
mount /dev/ad0s1a /mnt/ufs.1
mount /dev/ad0s1e /mnt/ufs.2
mount /dev/ad0s1f /mnt/ufs.3
mount /dev/ad0s1g /mnt/ufs.4
cd /home
cp backuproot.tar.gz /mnt/ufs.1
cp backupvar.tar.gz /mnt/ufs.2
cp backupusr.tar.gz /mnt/ufs.3
cd /mnt/ufs.1 && tar xzvf backuproot.tar.gz
cd /mnt/ufs.2 && tar xzvf backupvar.tar.gz
cd /mnt/ufs.3 && tar xzvf backupusr.tar.gz
cp /home/fstab /mnt/ufs.1/etc/fstab
boot0cfg -B ad0
So this worked to the point where I coudl reboot it and it was able to boot but had problems mounting some partitions.......

Well now when I run the screws up on the 2nd step?

The dd command t says its transfered some bytes but then says:
Dec 3 15:03:59 FreesBIE /kernel: ad0: cannot find label (no disklabel)
Dec 3 15:03:59 FreesBIE /kernel: ad0s1: cannot find label (no disklabel)
and then the script does the fdisk command and gives the invalid fdisk partition tabel found which I think is normal

But here is the main part that screws it all up, the disklabel part gives an error of
fixlabel: invalid magic
disklabel: ioctl DIOCWDINFO: no disk label on disk;
add "-r" to install initial label
Dec 3 15:03:59 FreesBIE /kernel: ad0: cannot find label (no disklabel)
Dec 3 15:03:59 FreesBIE /kernel: ad0s1: cannot find label (no disklabel)
Now the thing is that this MAGIC error should not happen since:

"Grep'ing the error message in the sources it leads to this snipped of
code in kern/subr_diskslice.c in function fixlabel() (line 855):

/* These errors "can't happen" so don't bother reporting details. */
if (lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC)
return ("fixlabel: invalid magic");
if (dkcksum(lp) != 0)
return ("fixlabel: invalid checksum");"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash scripting problem (bug?) zz9pluralzalpha Linux - Software 2 04-12-2005 02:51 PM
QTextEdit IO-problem/bug (Qt 3.3.3) bastl Programming 0 03-19-2005 10:16 AM
Strange problem or bug bato Slackware 3 02-18-2005 02:56 PM
Free86 bug or nVidia bug?? ProtoformX Linux - Software 2 05-12-2004 03:38 AM
FDISK : problem me or a bug? funtoos Linux - Software 13 08-09-2003 01:30 PM > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 09:34 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration