Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jan 1997 17:10:25 +0100 (MET)
From:      Greg Lehey <grog@lemis.de>
To:        kline@tera.com (Gary Kline)
Cc:        questions@FreeBSD.org (FreeBSD Questions)
Subject:   Re: can anybody make sense of this info?
Message-ID:  <199701271610.RAA12060@freebie.lemis.de>
In-Reply-To: <199701211838.KAA09290@athena.tera.com> from Gary Kline at "Jan 21, 97 10:38:33 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Gary Kline writes:
>
>
>
>   I've been trying to get a new SCSI drive mounted as sd1 for the
>   past 2 weeks.  I keep stumbling into obstacles....  It's closer
>   and closer, but not-quite.
>
>   Every time I reboot, dmesg prints this error:
>
>
>   sd1: invalid primary partition table: no magic
>   sd1: invalid primary partition table: no magic
>
>
>   Can anybody help me get rid of this error so that the mount of
>   sd1c is clean?
>
>   In /etc/fstab I have:
>
> (...)
>   ## SCSI drive #2
>   #
>   /dev/sd1c                       /usr/local2    ufs     rw 1 1
>   proc                            /proc           procfs  rw 0 0
>
>   When the system is already booted I can mount/umount
>   /dev/sd1 -t ufs /mnt
>   /dev/sd1c -t ufs /mnt
>
>   Trying  ``mount -t ufs /dev/sd1a /mnt'' fails because slice "a"
>   is meant for root, according to /etc/disktab:
>
>   # a == root
>   # b == swap
>   # c == d == whole disk

And c is the whole disk.  I don't know where you get d from, but
that's just a regular partition, at least nowadays.

>   # e == /var
>   # f == scratch
>   # h == /usr

With the exception of partition c, all of these are recommendations.

>   I can mount either sd1 or sd1c on <<wherever>> and it works.
>   But on rebooting, there is that ``invalid primary partition''
>   err.  Upon coming up, however, /dev/sd1*  _is_  in the mount
>   table.  `mount' finds it.
>
>   Here is my hacked /etc/disktab entry for the drive:
>
>
> ibm3720|IBM 720MB SCSI:\
>> dt=SCSI:ty=winchester:se#512:nt#4:ns#91:nc#3875:rm#4500: \
>> pc#1423360:oc#0: \
>> tc=4.2BSD:bc#4096:fc#512:
>
>
>   Does this look right?

No.

>   Am I missing something that would allow newfs to stick in the
>   magic number?

Yes.  The problem is that c is supposed to be the complete disk.
Typically, if you only want a single partition on your disk (a very
good idea, IMO, though many people don't like it), you should choose
another partition.  I tend to choose partition a if it's a root file
system (which means that only one disk has a partition a), b if it's a
swap partition, or h for anything else.  This isn't quite the same as
sysinstall will give you when you install by default: it'll put /usr
on partition e.  There's not much choice between the two, but I prefer
h.

For example, my machine has (locally):

=== grog@freebie (/dev/ttyp8) ~ 28 -> df
Filesystem    1024-blocks     Used    Avail Capacity  Mounted on
/dev/wd0a           30206    21850     5940    79%    /
/dev/wd0s1e       1152422   951538   108692    90%    /usr
/dev/sd0h          875927   602152   203701    75%    /home
/dev/sd1h         1841395   898420   795663    53%    /src
/dev/sd2h         3927761  3213385   400155    89%    /S

You *can* have more than one swap.  I've heard rumours that some
utilities can get confused if it's not on partition b, though that
would mean a bug in that utility, but there's no good reason not to
put it on b.  Thus, on the same system:

=== grog@freebie (/dev/ttyp8) ~ 29 -> pstat -s
Device      1024-blocks     Used    Avail Capacity  Type
/dev/wd0s1b       51200    17152    33984    34%    Interleaved
/dev/sd0b         98175    17052    81059    17%    Interleaved
Total            149247    34204   115043    23%

Getting back to your problem: by putting your file system on slice c,
you've obviously confused something.  At the moment it doesn't matter,
apart from this irritating message, but when you upgrade you could
conceivably have problems.  A more typical /etc/disktab entry for your
disk might be:

ibm3720|IBM 720MB SCSI:\
 dt=SCSI:ty=winchester:se#512:nt#4:ns#91:nc#3875:rm#4500: \
 pc#1423360:oc#0:bc#4096:fc#512:
 ph#1423360:oh#0:th=4.2BSD:bh#4096:fh#512:

To be honest, I'm not completely happy with this explanation.  We're
defining the h partition to be identical with the c partition.  This
is kosher, and it doesn't give the 'no magic' messages, but I'm not
100% sure why.  Is there possibly something else that you have done
that would explain the difference (maybe the 'dangerously dedicated'
mode)?  Or maybe it's because you specified 'tc=4.2BSD'.  Please let
me know what happens if you change anything.

Greg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701271610.RAA12060>