LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 12-03-2004, 04:51 PM   #1
sandboy6184
Member
 
Registered: Apr 2004
Posts: 40

Rep: Reputation: 15
A bug? Disklabel problem


I have a little script that sets up a freebsd box:
Code:
#!/usr/bin/sh
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 script...it screws up on the 2nd step?

The dd command t says its transfered some bytes but then says:
Code:
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
Code:
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");"
 
  


Reply



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 01:51 PM
QTextEdit IO-problem/bug (Qt 3.3.3) bastl Programming 0 03-19-2005 09:16 AM
Strange problem or bug bato Slackware 3 02-18-2005 01:56 PM
Free86 bug or nVidia bug?? ProtoformX Linux - Software 2 05-12-2004 02:38 AM
FDISK : problem me or a bug? funtoos Linux - Software 13 08-09-2003 12:30 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 07:33 PM.

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