Re: installing FreeBSD in VMWare-player

2010-09-09 Thread Matthias Apitz

I could solve the boot problem of the USB key in the older
laptop of my wife by inserting into /boot/loader.conf the line

kern.cam.scsi_delay=1

(note: set kern.cam.boot_delay did not help)

matthias
-- 
Matthias Apitz
«...una sola vez, que es cuanto basta si se trata de verdades definitivas.»
«...only once, which is enough if it has todo with definite truth.»
José Saramago, Historia del Cerca de Lisboa
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: installing FreeBSD in VMWare-player

2010-09-02 Thread Matthias Apitz

I wrote a small howTo for such a migration for others in the same
situation. Comments/Impromvements are welcome;

Thanks

matthias


$Id: moveFreeBSDintoVM.txt,v 1.2 2010/09/02 10:55:29 guru Exp $



   How to move a complete FreeBSD installation into a VM
Matthias Apitz g...@unixarea.de


1. Preparations in the running FreeBSD system

Save the current FreeBSD partition layout to paper, i.e.  print:

- /etc/fstab
- output of 'df -kh'
- output of 'bsdlabel ad8s4' (or whatever your disk is)

so you later know the sizes you will need in the new VM.

Reboot the system to single user mode, run fsck(8) in all
file systems and mount them read only, while staying single user.

Do dump(8) of all the partitions to some external media you
later can use in the VM a) physically and b) could be mounted
in FreeBSD. I used an USB disk with an UFS file system on it as
/dev/da0s1a:

# mount -t ufs /dev/da0s1a /mnt

# dump -0au -f /mnt/usr.dump   /usr
# dump -0au -f /mnt/var.dump   /var
# dump -0au -f /mnt/root.dump  /

Finally shutdown the system.



2. Prepare the VM 

Attach resources big enough to reflect your real system to
the VM. I used:

RAM: 2 GByte
IDE: 164 GByte (as one file in the host)

Make sure that the VM's boot order is: 1st CD/DVD, 2nd disk, so you
later can easy decide from where to boot by just attaching or not
the CD/DVD to the VM, even if the disk has already a MBR. Copy an
ISO image of the so called FreeBSD livefs to the host and attach
this as CD/DVD to the VM




3. Partitioning of the disk

This part is a bit tricky because the FreeBSD livefs does not
really guide through it. Boot from FreeBSD livefs and

- define country and keyboard
- run standard installation from the menu
- fdisk(8) the disk, use entire disk for FreeBSD
- let it install FreeBSD's boot manager
- partition the slice to the layout of your old system, i.e. to
  the following result:

  /dev/ad0s1a1 GByte /
  /dev/ad0s1b4 GByte swap
  /dev/ad0s1d2 GByte /var
  /dev/ad0s1e6 GByte /tmp
  /dev/ad0s1f(rest 146 GByte)/usr

- commit the last chance before scribbling on disk

The installer will now do the real fdisk(8) and BSD-label of
the partitions. It will newfs(8) the above file system and try
to install FreeBSD in it, which is not on the CD/DVD and which
is not what we want. Answer all questions as NO to get finally
back to the main menu of sysinstall(8) tool.

Reboot again into the FreeBSD livefs and go to the fixit repair
mode menu, start a shell. The above mentioned file systems are
created fine and even the boot manager is fine in place (ofc it
would not find anything to boot). The file systems are already
polluted which things we don't want (because we later will restore
from dumps). Run newfs(8) in all file system devices again:

# newfs -m 0 -o space /dev/ad0s1a 
# newfs -m 0 -o space /dev/ad0s1b 
# newfs -m 0 -o space /dev/ad0s1d 
# newfs -m 0 -o space /dev/ad0s1e 
# newfs -m 0 -o space /dev/ad0s1f 

We now have clean file systems (and boot manager installed).


4. Restore the dumps

First restore the old root file system using the booted FreeBSD livefs,
mount the new root as /mnt and the USB disk containing the dumps as /usb:

# mount /dev/ad0s1a /mnt
# mkdir /usb
# mount -t usf -o ro /dev/da0s1a /usb
# cd /mnt
# restore rf /usb/root.dump
# cd /
# umount /mnt

One could as well restore the other dumps the same way, but it's
better to see if the new root file system already boot fine, because
restoring the /usr dump will take many hours (in my case 9 hours for
120 GByte), 

Reset the VM (no need to worry, nothing is mounted), detach the
CD/DVD and reboot the old/new root file system into single user
mode. Remount the /root writable and restore the /usr dump:

# mount -o rw /
# mount -t usf -o ro /dev/da0s1a /mnt
# mount /dev/ad0s1f /usr
# cd /usr
# restore rf /mnt/usr.dump

(after 9 hours)

# mount /dev/ad0s1d /var
# cd /var
# restore rf /mnt/var.dump

Check and edit the /etc/fstab to reflect the new device names
(in my original system the disk was /dev/ad0s8 and not /dev/ad0s1).

Make /tmp writable for all users

# mount /dev/ad0s1e /tmp
# chmod 1777 /tmp

The system is now installed and should be boot up fine to normal
multi user mode, just reboot normally.


5. Final changes

Edit some system files to reflect the new VM environment:

/etc/rc.conf:

   - network interface is now em0, and not wlan0

/boot/loader.conf

   - sound (still not working)

/etc/X11/xorg.conf

   - recreate the X11 config file the normal way

install the vmware-tools for FreeBSD (still pending)




6. Some notes about performance

The host is Dell Precision M4400 with Dual Core CPU of 3.09 GHz and
runs Windows 7 Professional.

It took 9h to restore a dump of /usr which was produced in ~2h.

The compared write 

Re: installing FreeBSD in VMWare-player

2010-09-01 Thread Matthias Apitz
El día Tuesday, August 31, 2010 a las 03:13:51PM +0200, Matthias Apitz escribió:

 Now I have already again my 'old' root partition booting to single user
 mode and I'm filling in the 120 GByte dump of the /usr ... The 1st try
 crashed the Win7 to blue screen over the night :-(

The 2nd try was successfull. It took 9 hours to get the dump restored.
The system now boots fine, even of course slower than native.

I still strougle with some smaller issues:

Xorg uses only 1280x720, while the full host display is NVidia support
1920x1200;

I can't get sound to work; the sound device is attached to the VM, the
kernel loads snd_emu10k1.ko  and sound.ko, but no device shows up.

Any ideas?

matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e g...@unixarea.de - w http://www.unixarea.de/
Solidarity with the zionistic pirates of Israel?   Not in my  name!
¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: installing FreeBSD in VMWare-player

2010-08-31 Thread Matthias Apitz
El día Monday, August 30, 2010 a las 11:31:13AM +0200, Matthias Apitz escribió:

 El día Friday, August 27, 2010 a las 12:06:09PM +0300, Manolis Kiagias 
 escribió:
 
   On 27/08/2010 10:24 ??.??., Matthias Apitz wrote:
  
   Is it possible that the data gets corrupt on an USB key after some time?
   I'm wondering why the system even is intact to be booted from...
  
   Will prepare the key again or just fill in the dumps I have...
  
 matthias
 
 I prepared another USB key which boots fine in my laptop, boots fine in
 the other laptop native (i.e. without VM-player); but in the
 VM-player and in an older laptop of my wife it can't mount the root file
 system on boot; it says:
...


Because the USB key was not booting in the VM I've now used a 8.0 livefs
ISO to boot from. I used this livefs for the 1st time, I think, and even beeing
an experienced FreeBSD user for more than 15 years it is not easy to
understand how the livefs should be best use to

1) partition the slice and install boot manager
2) restore dumps from the USB disk I have

The livefs brings you into the same menu like any other install CD. I
was awaiting a straight forward boot into a multiuser run level and
then do the work from there. Ofc you can user the installer and dont
install anything (because there is nothing in this moment on the CD),
and then jump to the shell. In this case the created file systems are
already poluted with some stuff and are mounted together. I found no way
to unmount /mnt/ad0s1a (todo newfs again). It always said 'busy'. 

So I booted a 2nd time the livefs and went right away to the shell...

Now I have already again my 'old' root partition booting to single user
mode and I'm filling in the 120 GByte dump of the /usr ... The 1st try
crashed the Win7 to blue screen over the night :-(

matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e g...@unixarea.de - w http://www.unixarea.de/
Solidarity with the zionistic pirates of Israel?   Not in my  name!
¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: installing FreeBSD in VMWare-player

2010-08-30 Thread Matthias Apitz
El día Friday, August 27, 2010 a las 12:06:09PM +0300, Manolis Kiagias escribió:

  On 27/08/2010 10:24 ??.??., Matthias Apitz wrote:
 
  Is it possible that the data gets corrupt on an USB key after some time?
  I'm wondering why the system even is intact to be booted from...
 
  Will prepare the key again or just fill in the dumps I have...
 
  matthias

I prepared another USB key which boots fine in my laptop, boots fine in
the other laptop native (i.e. without VM-player); but in the
VM-player and in an older laptop of my wife it can't mount the root file
system on boot; it says:

...
umass0: SCSI over Bulk-Only; quirks = 0x000
Root mount waiting for; usbus1
aumass0:1:0:-1 Attached to scbus1
uhub_explore:592: illegal enable change, port 1
da0at umass-sim0 bus 0 target 0 lun 0
da0: Intenso Premium 0.00 Remobeable Direct Access SCSI-2 device
da0: 40.000MB/s travsfer
da0: 7701MB (... byte per sector info)
Trying to mount root from ufs:/dev/da0s1a

Manual root file system specification...

when I specify manually the root as 'ufs:/dev/da0s1a' the same message
comes again;

looks like some timing problem, or? this is with 8-CURRENT based on CVS
of March 2009.

Any hints?

matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e g...@unixarea.de - w http://www.unixarea.de/
Solidarity with the zionistic pirates of Israel?   Not in my  name!
¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


installing FreeBSD in VMWare-player (was: running FreeBSD on Windows host)

2010-08-27 Thread Matthias Apitz
El día Tuesday, August 24, 2010 a las 01:10:00PM +0300, Manolis Kiagias 
escribió:

  I have produced three dumps: from the /, /var and /usr file system. The
  man page of restore(8) reads about creating pristine file system, made
  by newfs(8). Later, in the VM environment, I'd like to have only one big
  file system... Is it possible to restore the tree dumps into one big
  file system or do I have to rebuild the same slicing as I now have?

 
 You won't have to rebuild the slicing. Just create the relevant
 directories in your big file system, cd into them and use restore.

Will it be a problem having the kernel /boot/* in this case far away from
the beginning of the partition?

I did some 1st tests with installing FreeBSD into a VM.

I grabed some other laptop which runs already Win7 and installed a
VMWare-player in it to do some tests. Of course the VMWare-player was
not able to boot from a prepared USB key. A workaround was a boot from
some ISO image of a boot manger (I used plpbt-5.0.10.zip from
http://www.plop.at/) which allows you to choose the USB storage as boot 
device after 1st stage boot.

The system comes up fine from the USB key and I created a 160 GByte
slice with the standard procedure like:

# fdisk -I /dev/ad0
# fdisk -B /dev/ad0

# bsdlabel -w ad0s1 auto
# bsdlabel -B ad0s1

edit the disk label and change partition a from unused to 4.2BSD
as partition type:

# setenv EDITOR /usr/bin/vi
# bsdlabel -e ad0s1

create the future root-filesystem on it and mount it to /mnt for the
installation:

# newfs -m 0 -o space /dev/ad0s1a
# mount /dev/ad0s1a /mnt 

install freebsd into /mnt; this assumes that you have the kernel and
userland in /usr/src and /usr/obj ready to be installed;

# cd /usr/src
# make installworld DESTDIR=/mnt

The 'make installworld' failed with errors in the Makefiles (...); for
example the file /usr/src/lib/libc/uuid/Makefile.inc had a line like
this:

SRCS+?  uuid_compare.c uuid_create.c uuid_create_nil.c uuid_equal.c \
uuid_from_stringc uuid_hash.c uuid_is_nil.c uuid_stream.# \
uuid_to_string.c

where it should have:

SRCS+=  uuid_compare.c uuid_create.c uuid_create_nil.c uuid_equal.c \
uuid_from_string.c uuid_hash.c uuid_is_nil.c uuid_stream.c \
uuid_to_string.c

(note the ? singn and the # sign), i.e. the content was broken and some
other files were missing in the /usr/src tree of the USB key. I used the
same key last year to install from it the system to my netbook EeePC and
it worked like it should. Since then the USB key was unused and carried
around in the bag of my laptop.

Is it possible that the data gets corrupt on an USB key after some time?
I'm wondering why the system even is intact to be booted from...

Will prepare the key again or just fill in the dumps I have...

matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e g...@unixarea.de - w http://www.unixarea.de/
Solidarity with the zionistic pirates of Israel?   Not in my  name!
¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: installing FreeBSD in VMWare-player

2010-08-27 Thread Manolis Kiagias
 On 27/08/2010 10:24 π.μ., Matthias Apitz wrote:

 Is it possible that the data gets corrupt on an USB key after some time?
 I'm wondering why the system even is intact to be booted from...

 Will prepare the key again or just fill in the dumps I have...

   matthias


I've heard of stories of data 'fading out' from USB flash drives after
some period of complete inactivity.
Haven't experienced this myself though. Otherwise your procedure looks
fine and it shouldn't fail.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: installing FreeBSD in VMWare-player

2010-08-27 Thread Matthias Apitz
El día Friday, August 27, 2010 a las 12:06:09PM +0300, Manolis Kiagias escribió:

  On 27/08/2010 10:24 ??.??., Matthias Apitz wrote:
 
  Is it possible that the data gets corrupt on an USB key after some time?
  I'm wondering why the system even is intact to be booted from...
 
  Will prepare the key again or just fill in the dumps I have...
 
  matthias
 
 
 I've heard of stories of data 'fading out' from USB flash drives after
 some period of complete inactivity.
 Haven't experienced this myself though. Otherwise your procedure looks
 fine and it shouldn't fail.

A dump of the key gives several error messages:

# dump -0au -f usb8.dmp /dev/da0s1a
  DUMP: Date of this level 0 dump: Fri Aug 27 14:06:04 2010
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/da0s1a to usb8.dmp
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 3980686 tape blocks.
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: 52.81% done, finished in 0:04 at Fri Aug 27 14:15:35 2010
  DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [block
4992928]: count=8192
read error from /dev/da0s1a: Input/output error: [block 4992870]:
count=10240
  DUMP: read error from /dev/da0s1a: Input/output error: [block
4992896]: count=7168
  DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [sector
4992928]: count=512
  DUMP: read error from /dev/da0s1a: Input/output error: [sector
4992870]: count=512
read error from /dev/da0s1a: Input/output error: [sector 4992896]:
count=512
  DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [sector
4992899]: count=512
  DUMP: read error from /dev/da0s1a: Input/output error: [sector
4992931]: count=512
read error from /dev/da0s1a: Input/output error: [sector 4992873]:
count=512
  DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [block
5032906]: count=10240
read error from /dev/da0s1a: Input/output error: [block 5032928]:
count=9216
  DUMP: read error from /dev/da0s1a: Input/output error: [block
5032946]: count=7168

I will re-create the key or even use another media;

matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e g...@unixarea.de - w http://www.unixarea.de/
Solidarity with the zionistic pirates of Israel?   Not in my  name!
¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: installing FreeBSD in VMWare-player

2010-08-27 Thread Manolis Kiagias
 On 27/08/2010 3:17 μ.μ., Matthias Apitz wrote:
 El día Friday, August 27, 2010 a las 12:06:09PM +0300, Manolis Kiagias 
 escribió:

  On 27/08/2010 10:24 ??.??., Matthias Apitz wrote:
 Is it possible that the data gets corrupt on an USB key after some time?
 I'm wondering why the system even is intact to be booted from...

 Will prepare the key again or just fill in the dumps I have...

 matthias

 I've heard of stories of data 'fading out' from USB flash drives after
 some period of complete inactivity.
 Haven't experienced this myself though. Otherwise your procedure looks
 fine and it shouldn't fail.
 A dump of the key gives several error messages:

 # dump -0au -f usb8.dmp /dev/da0s1a
   DUMP: Date of this level 0 dump: Fri Aug 27 14:06:04 2010
   DUMP: Date of last level 0 dump: the epoch
   DUMP: Dumping /dev/da0s1a to usb8.dmp
   DUMP: mapping (Pass I) [regular files]
   DUMP: mapping (Pass II) [directories]
   DUMP: estimated 3980686 tape blocks.
   DUMP: dumping (Pass III) [directories]
   DUMP: dumping (Pass IV) [regular files]
   DUMP: 52.81% done, finished in 0:04 at Fri Aug 27 14:15:35 2010
   DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [block
 4992928]: count=8192
 read error from /dev/da0s1a: Input/output error: [block 4992870]:
 count=10240
   DUMP: read error from /dev/da0s1a: Input/output error: [block
 4992896]: count=7168
   DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [sector
 4992928]: count=512
   DUMP: read error from /dev/da0s1a: Input/output error: [sector
 4992870]: count=512
 read error from /dev/da0s1a: Input/output error: [sector 4992896]:
 count=512
   DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [sector
 4992899]: count=512
   DUMP: read error from /dev/da0s1a: Input/output error: [sector
 4992931]: count=512
 read error from /dev/da0s1a: Input/output error: [sector 4992873]:
 count=512
   DUMP:   DUMP: read error from /dev/da0s1a: Input/output error: [block
 5032906]: count=10240
 read error from /dev/da0s1a: Input/output error: [block 5032928]:
 count=9216
   DUMP: read error from /dev/da0s1a: Input/output error: [block
 5032946]: count=7168

 I will re-create the key or even use another media;

   matthias

Try recreating, preferably newfs the key first. Don't be surprised if
you find out you need a new USB key.
This reminds me of a recent incident I had with another key (of a
respected brand as well) which failed and disappeared(!) from the bus
while I was writing to it, plugged in on my freebsdgr.org server. Not
only I had to umount -f, but subsequently seems the whole USB subsystem
got 'stuck' and I had to reboot the server for it to work again.
As I said, I have not witnessed 'data fading' in USB flash drives, but
this the third one I throw away due to total hardware failure...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: installing FreeBSD in VMWare-player

2010-08-27 Thread Matthias Apitz
El día Friday, August 27, 2010 a las 04:20:41PM +0300, Manolis Kiagias escribió:

 Try recreating, preferably newfs the key first. Don't be surprised if
 you find out you need a new USB key.

newfs(8) did not worked; a format in Win7 lies that it was fine and
stops later writing to it after 2 GByte of 8; have to look for another
key;

thx

matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e g...@unixarea.de - w http://www.unixarea.de/
Solidarity with the zionistic pirates of Israel?   Not in my  name!
¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org