If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
From: Bela Lubkin <belal@sco.com> Subject: Re: Need help cloning drive. (UW 2.1/UW 7.1) Date: Sun, 22 Feb 2004 11:29:11 GMT Message-ID: <20040222112910.GJ24746@sco.com> References: <20040212040849.22659.00001336@mb-m19.aol.com> CHoaglin wrote: > I'm working with a voice-over-IP box made by lucent, which happens to > essentially be a passive-backplane single board setup in a rackmount AT card, > running Unixware 2.1.2 from a Quantum Fireball 4.3GB single-ended SCSI drive. > Trouble is I don't know the root password. I've been round and round with it, > figuring out how to work with the drives, get them recognized, load hba > drivers, break out of installers to do all that, etc. (With a lot of helpful > advice from Tony Lawrence and Frank, thanks guys!) > > At this point I have obtained a set of 7.1.3 install media, and installed it > another another drive on the SCSI bus, which I am booting from. I can see the > original drive with fstyp, prtvtoc, fsck, mount, etc, and I'm familiar with how > to edit the password file to reset the password. > > Note: I have already tried to reset by booting from various 2.1.x install > disks, but they won't seem to see my HBA, so there are no devices in /dev/dsk > or /dev/rdsk besides floppy devices (things starting with f) My host adapter is > not really a particular model, but it's AIC-7880(or I think that's the chip > number) > based(SCSI is on board on the single board computer that runs the box) > Under 7.1.3 it works with the "adsl" driver. > > The issue right now is that it claims the drive is corrupted and wants to do a > full fsck of the drive before allowing me to mount it, and I'm slightly > apprehensive about letting 7.1.3's fsck loose on a drive is native to 2.1.2, > especially given it being my only copy of the data. > Also, the 2.1.2 drive boots fine on its own, so I would doubt that it is > *actually* corrupted.
> When I try to mount it, it hiccups like so: > mount -F vxfs /dev/dsk/c0b0t1d0s1 /mnt > UX:vxfs mount: ERROR: /dev/dsk/c0b0t1d0s1 is corrupted. needs checking > > When I try to fsck it wants to do a full one: > fsck -F vxfs /dev/dsk/c0b0t1d0s1 > log replay in progress > US:vxfs fsck: ERROR file system does not contain a valid log > UX:vxfs fsck: ERROR: cannot perform log replay > full file system check required, exiting ... > > ----------- > My questions: > > 1. Will 7.1.3's fsck successfully work on a 2.1.2 drive? Chances are it would, but you don't want to take chances here. SCO OpenServer, in this situation, will allow you to mount the filesystem read-only without running `fsck`. Try that: `mount -r -F vxfs ...` -- does it go through? If so, now you can make a backup using a supertar or regular tar/cpio. > 2. How can I clone the drive to make a backup copy before attempting to fsck it > fully (fsck -F vxfs -o full /dev/dsk/c0b0t1d0s1) (or should I be fsck'ing it as > a raw device rather than block device?) I understand that unixware is very > picky about geometry being the same between two drives and dd will most likely > not work properly because the slices would end up in the wrong places. I started to write an answer heading for a goal of getting all the files extracted off the box. Then I realized that wasn't what you wanted at all -- you want to change the root password without disturbing the existing, working system. Right? Well, here are some things you can try. There should be enough hints here for you to get things to work. I can't give you an actual step by step program to follow, you need to put it together with your wits, trial and error.
Geometry shouldn't be an issue at the slice level. UW713 recognizes the
contents of the root slice as a VxFS, so it's clearly found the right
start block. To take advantage: dd the entire root slice into a file.
(While you're doing that, you should probably make dd images of the
other slices as well, for safe keeping. The /home slice is over 2GB,
which could be an issue if you don't have a filesystem on the UW713 box
with large files enabled. But it's only a little over 2GB, so you can
just compress it on the way in, something like `dd if=/dev/[slicename] |
compress > /save/UW212-home.Z`)
Now, on a new trashable disk, set up a UW7 partition with a mountable
slice at least as big as the one you're trying to get into. Make sure
that slice is not mounted, then dd the root slice image onto it. (You
could do this directly, slice to slice, but you want to keep a safe copy
of the original anyway; having it in a file as well as on the original
disk adds safety.)
As long as the target slice is larger than the source, things should be
fine. The filesystem isn't going to care about living in a larger box.
Once it's all dd'd, now you can experiment with fsck'ing the copy.
Suppose that succeeds and you can now mount the filesystem. Now you
should be able to modify the password files to get you in as root. If
you're satisfied that you've done all that correctly, now you can
unmount the root-copy slice and dd it back over the original root slice
(making sure to copy only the original size). By doing this you're
destroying the original, so now you want to be especially sure you have
that file copy in a safe place.
Then you boot from the (rewritten) UW212 root slice, see if it's still
happy with itself. If not, you boot UW7 again and dd the original
(unmodified) root slice image back onto the disk. Here's where it might
turn out to be important that you have copied of all the slices. If the
UW713 `fsck` _does_ cause a problem, the modified system could crash
hard, in a way that damages the other filesystems. This seems very
unlikely, but you shouldn't risk it.
Where I talk about using slices on a trashable disk, you could also use
the marry(1M) command. This makes a regular file into a block device,
thus allowing you to mount it. If you do it this way, remember that you
should still copy the data. You'll want a sequence like:
dd if=/dev/[old-root-slice] of=/save/UW212-root
dd if=/dev/[old-home-slice] of=/save/UW212-home
... save other slices ...
cp /save/UW212-root /save/UW212-root.unmodified # important backup copy!
marry -a /save/UW212-root
fsck -F vxfs -o full /dev/marry/save/UW212-root
mount -F vxfs /dev/marry/save/UW212-root /mnt
... fix root password ...
umount /mnt
dd if=/save/UW212-root of=/dev/[old-root-slice]
... reboot from UW212 root ...
... if that no longer boots:
... reboot UW713 root ...
dd if=/save/UW212-root.unmodified of=/dev/[old-root-slice]
... reboot from UW212 root ...
... if still problems:
... reboot UW713 root ...
dd if=/save/UW212-home.unmodified of=/dev/[old-home-slice]
... restore other slices ...
... reboot from UW212 root ...
Good luck,
>Bela<
/Bofcusm/2438.html copyright 1997-2004 (various authors) All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar