* Wrote over the RZ26L disklabel
@ 1996-04-11 4:00 John Sanders
1996-04-12 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1996-04-23 4:00 ` "Mark Jeffery"
0 siblings, 2 replies; 3+ messages in thread
From: John Sanders @ 1996-04-11 4:00 UTC (permalink / raw)
I distroyed the disklabel on the RZ26L I was using as the system disk on
my AlphaStation 400. I dodnt remember exactly how the disk was
configured. I used disklabel to put a new label on the disk and edited
it to show the BSD file system. The "a" partition works fine - mounts
just fine - but I need the "g" partition where the /usr stuff is
located. fsck just complains about the "magic number" of the superblocks
being fouled up. Probably because the start of the partition or its size
is wrong. Is there anything I can do to find the start and extent of the
"g" partition on this disk?
Thanks in advance -
--
_____________________________________
john sanders <jsanders@globalcom.net>
>- it can be done -<
-------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Wrote over the RZ26L disklabel
1996-04-11 4:00 Wrote over the RZ26L disklabel John Sanders
@ 1996-04-12 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1996-04-23 4:00 ` "Mark Jeffery"
1 sibling, 0 replies; 3+ messages in thread
From: Alan Rollow - Dr. File System's Home for Wayward Inodes. @ 1996-04-12 4:00 UTC (permalink / raw)
In article <316D7FCA.41C6@globalcom.net>, John Sanders <jsanders@globalcom.net> writes:
>I distroyed the disklabel on the RZ26L I was using as the system disk on
>my AlphaStation 400. I dodnt remember exactly how the disk was
>configured. I used disklabel to put a new label on the disk and edited
>it to show the BSD file system. The "a" partition works fine - mounts
>just fine - but I need the "g" partition where the /usr stuff is
>located. fsck just complains about the "magic number" of the superblocks
>being fouled up. Probably because the start of the partition or its size
>is wrong. Is there anything I can do to find the start and extent of the
>"g" partition on this disk?
If the file systems on the disk are UFS, then it may be possible to reconstruct
enough of the partition table. It may be possible with AdvFS, but the on-disk
format is too under-documented.
A UNIX File System starts with space for a boot block. 8 KB of space is
set aside for it, even when the partition isn't bootable. The next 8 KB
is the primary superblock. The next 8 KB is the backup superblock. Since
superblocks have magic numbers and other fields that can help uniquely
identify them as superblocks all you need to do is:
1. Open the raw device.
2. Read 8 KB and see if it is a superblock. If so, read the next 8 KB
and see if it is a superblock. Once you have to superblock back to
back, then you probably have the primary and first backup. The start
of the partition is 8 KB back from the start of the first one. The
(used) size of the partition is one of the fields in the superblock.
Note: I said *used* size because the newfs command supports a
-s option to explicitly set the size. Since newfs verifies that
it can write the last sector of a partition, you can't lie and
use a larger size. But you can use a SMALLER size. The actual
partition may be larger.
3. If the first 8 KB from #2 isn't a superblock, advance the offset one
sector and repeat step #2.
4. If you think other filesystem may be on the disk, you can either
continue the search from the last superblock pair found, in case
those weren't a file system or from the end of the file system
you did find.
Hints for writing such a program:
1. You'll need to include <ufs/fs.h> and anything it requires. It
so happens that on Digital UNIX V3.0, <ufs/fs.h> is sufficient.
2. The data structure for the superblock may be larger or smaller
than 8 KB. Use SBSIZE for doing I/O, not the size of (struct fs).
>
>Thanks in advance -
>
>--
>_____________________________________
>john sanders <jsanders@globalcom.net>
>
> >- it can be done -<
>
>-------------------------------------
>
--
Alan Rollow alan@nabeth.cxo.dec.com
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Wrote over the RZ26L disklabel
1996-04-11 4:00 Wrote over the RZ26L disklabel John Sanders
1996-04-12 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
@ 1996-04-23 4:00 ` "Mark Jeffery"
1 sibling, 0 replies; 3+ messages in thread
From: "Mark Jeffery" @ 1996-04-23 4:00 UTC (permalink / raw)
I once overwrote the disklabel using disklabel -rz. Luckily this only
changes the in memory version of the disklabel. I was able to restore it
by omitting the -r option!
I'm not sure this will help you though.
Mark Jeffery
^I ^a^m ^a ^c^o^n^t^r^o^l ^f^r^e^a^k
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-04-23 4:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-04-11 4:00 Wrote over the RZ26L disklabel John Sanders
1996-04-12 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1996-04-23 4:00 ` "Mark Jeffery"
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox