Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 2015 07:47:05 -0700
From:      David Newman <dnewman@networktest.com>
To:        freebsd-questions@freebsd.org
Subject:   Missing boot loader (was: Re: creating a virtual clone)
Message-ID:  <55687BE9.40803@networktest.com>
In-Reply-To: <CA%2Bg%2BBvhB29m6w3DqrDoXmA%2Bj9VyvX_7xLRG_iKQAfVJS6ELjpQ@mail.gmail.com>
References:  <5522C5DE.1050005@networktest.com> <CA%2Bg%2BBvhB29m6w3DqrDoXmA%2Bj9VyvX_7xLRG_iKQAfVJS6ELjpQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/6/15 9:28 PM, Olivier Nicole wrote:

> My solution is http://www.cs.ait.ac.th/~on/technotes/archives/2015/01/30/how-to_clone_a_freebsd_virtual_machine_on_vmware/index.html
> certainly not the best/fastest, but it works.

Thanks for this. After following the clone instructions, restore appears
to work, but the system comes up with a "Missing boot loader" error.

This is perhaps because the next-to-last step from the live CD is:

cd /
mount -o rw /dev/da0p1 /mnt
gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptboot -i 1 da0

And that returns "/dev/da0p1: Operation not permitted" even though da0p1
is the target system's root/boot partition.

I've pasted below the complete procedure. What's missing?

Thanks in advance for troubleshooting clues.

dn


1. Create the virtual machine with vSphere client

2. Boot VM using FreeBSD live CD

3. Partition disk (one ufs in da0p1, one swap in da0p2, do newfs on da0p1)

4. enable and start network interface on target VM:

ifconfig em0 inet 1.1.1.2/24

5. mount root system on VM with 'mount /dev/da0p1 /mnt'

6. copy dump source filesystem using restore:

cd /mnt
ssh user@1.1.1.1 "cat /home/user/srcmachine.dump" | restore -r -f -
cd /
umount /mnt

7.  enable and start network interface on target VM:

ifconfig em0 inet 1.1.1.2/24

8. configure the bootloader:

mount /dev/da0p1 /mnt
gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptboot -i 1 da0

((NOTE: Per the notes above, this step does not work.))

9. Configure /mnt/etc/fstab to use /dev/da0p1 as root and /dev/da0p2 as swap







> 
> Best regards,
> 
> Olivier
> 
> On Tue, Apr 7, 2015 at 12:43 AM, David Newman <dnewman@networktest.com> wrote:
>> To test some new software, I'd like to replicate a 9.3-RELEASE machine
>> and run it as a virtual machine (in this case inside VMware vSphere, but
>> I'm open to using other hypervisors if this isn't possible with VMware).
>>
>> The 9.3 host is itself virtual, running as a VPS instance in a colo.
>>
>> What's the best way to do this?
>>
>> Thanks!
>>
>> dn
>>
>> _______________________________________________
>> freebsd-questions@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 



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