Can't find kernel, finds slices but no files on them
mail at fritiofhedman.se
Thu Sep 20 19:54:36 UTC 2012
On 20 September 2012 00:59, Polytropon <freebsd at edvax.de> wrote:
> On Thu, 20 Sep 2012 00:22:20 +0200, Fritiof Hedman wrote:
>> On 19 September 2012 23:37, Polytropon <freebsd at edvax.de> wrote:
>> > On Wed, 19 Sep 2012 23:28:30 +0200, Fritiof Hedman wrote:
>> >> Hi list!
>> >> I must warn you, I'm quite new to FreeBSD (I'm mostly using Linux
>> >> otherwise). I have inherited an old (yes, very old) BSD 4.7 machine on
>> >> my work that I need to clone. I've setuped an identical copy of the
>> >> slices on the target machine, ran dump the source machine and restore
>> >> on the target machine, edited /etc/fstab to match the filesystems. I'm
>> >> also running the GENERIC-kernel, I've done this using the FreeSBIE
>> >> live CD.
>> > What procedure did you use to clone? There basically is
>> > the "one" way, using dump + restore on partitions (not
>> > slices!), or dd on either partitions, slices, or the
>> > whole disk.
>> I maybe not so sure about the nomenclature that is used in FreeBSD.
> The terminology is simple and as follows:
> A disk is a disk, e. g. /dev/ad0.
> A slice is a "DOS primary partition" on the disk, e. g. /dev/ad0s1.
> A partition is a subdivision of a slice, e. g. /dev/ad0s1a.
> Partitions can be used without a slice that encloses them,
> e. g. /dev/ad0a; this is called "dedicated mode" (because
> some obscure operating systems may have problems accessing
> something they cannot even understand).
> Tools like dump and restore operate on partitions.
> Tools like dd operate on everything.
Thanks for the clarification!
>> However, I dumped / on the source machine, and restored on /mnt/tmp
>> on the source machine.
> I assume you did dump and restore via network?
> Like this?
> Or this?
A combination of those...
dump -C16 -b64 -0uan -h0 -f - / | ssh -c blowfish user at otherhost
(cd /tmp && restore -ruf -)
> Or did you have both disks in the same machine and transfer
> from one disk to the other?
> Anyway, if you have already reliably (!) confirmed that all
> data is in the location they are supposed to be, your
> copying procedure should have been fine.
>> >> However, when I boot I get to BTX loader (so I guess boot0 and boot2
>> >> is correct), that can't load kernel nor kernel.old. see attached
>> >> img1.png .
>> > Images cannot be attached to list messages. :-(
>> Oh, I see. It essentilally says something like:
>> BTX loader 1.00 BTX version is 1.01
>> Console: internal video/keyboard
>> BIOS drive A: is disk0
>> BIOS drive C: is disk1
>> BIOS 638kB/1046464kB available memory
>> FreeBSD/i386 bootstrap loader, Revision 0.8
>> (root at builder.freebsdmall.com, Wed Oct 9 12:33:26 GMT 2002)
>> Hit [Enter] to boot immediately, or any other key for command prompt.
>> Booting [kernel]
>> can't load 'kernel'
>> can't load 'kernel.old'
>> Type '?' for a list of commands, 'help' for more detailed help.
>> ok ls
>> open '/' failed: no such file or directory
> Did you try "echo *" and "echo /boot/*" (and related important
> directories) to make sure? Note that the "*" is _required_ in
> this specific case.
As you saw, the prompt just returns *.
>> >> I can't ls, as the loader says there is no such file or
>> >> directory (also seen in img1.png).
>> > You can use "echo *" in the loader stage, if I remember
>> > correctly. Enter "?" for a list of the available loader
>> > commands (or was it "help"?).
>> echo * just prints a pretty asterisk :)
> I'm not sure if this is really the proper command at the "ok"
> prompt (which is the state prior to loading the kernel); I
> could shutdown my machine to check...
> As I'm not very often sitting at the "low level prompts",
> "Ok" and "boot:", I'm not really sure.
>> It was more or less that way I did id, the difference were that I
>> mounted /usr under /, and not unmount each partition every time.
> That's not required as long as your CWD within the hierarchy
> for restoring is correct, and the mountpoints you want to
> restore to are correctly accessible. For example, if you
> missed to mount /mnt/usr to (let's say) /dev/ad1s1e (the
> partition that would be /usr soon), stuff would go to the
> wrong place.
Everything got to the new place, so that should not be the problem.
> Did you transfer a multi-partition system (typically /, /var,
> /tmp, /usr and /home) or do you have everything in one big /
>> rerunning as the first document says that I should do (ie unmount the
>> partition that I've just dumped and restored). I've justed tested to
>> do as described in the document, with the very same result.
> You should not mount the partition you _dump from_ (even
> though it's possible); only the partition you _restore to_
> has to be (!) mounted. It doesn't basically matter _where_
> it is mounted. As you could already locate the data at the
> correct places, we can assume that you did everything correct.
> To be sure, you could fsck the destination disks's partitions.
> Make sure they are not mounted. That should be no problem from
> a FreeSBIE disc (which I also consider a very good tool).
>> Yeah, that's my guess as well. Maybe I should do the minimal install
>> of the FreeBSD image first, boot into a live mode and then restore
>> everything upon the disks?
> As a lazyness graduate, this is what I do (when I don't have
> a scripted solution, e. g. for only _one_ use). :-)
> Make sure you have set all the required boot code (fdisk and
> bsdlabel), for example with the target disk already being in
> its desired position. Note that you can add labels to avoid
> trouble with device names.
> Examples here:
> And in The FreeBSD Handbook:
>> That would keep any boot flags on the disks
>> right. But the thing that is annoying is that the loader can't browse
>> the content of the disk. I guess that's the main issue here.
> If you can use "lsdev" to properly identify your desired
> boot device, you could try to directly boot the kernel:
> boot /dev/disk0s1a/boot/kernel/kernel
> (if disk0s1a is the / partition of your installation).
That doesn't work either
> That is what rootdev= should be set to in /boot/loader.conf,
> if not the default.
> You can find more information in The FreeBSD Handbook:
> And of course: "man 8 boot" as well as "man 8 loader" which
> indicates that "ls" is the correct command, not "echo *" (which
> must therefor be a correct command somewhere else). :-)
HOWEVER, It seems that FreeSBIE is the thing that makes things up. It
seems that FreeSBIE uses somewhat newer versions of something about
the fs that the old machine can't read.
I installed the very mini thing from the FreeBSD 4.7 CD, and then
restored every partition again.
On boot the system complains about the other partitions that is NOT
set as newfs by the installer. I made a newfs, restored those
partitions again and then it worked. Note that this is on my virtual
system, I'm going to test at work tomorrow.
And yes, the complaint was that the vas a bad magic number on the
super block on each partition.
Thank you very much for your time!
More information about the freebsd-questions