This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== FreeBSD Installation ====== To test [[http://p.outlyer.net|my programs]] against a POSIX system I use both a VM and a local installation of FreeBSD. ===== VM install notes ===== **Don't use ne2k_pci as network card**, at least on my system (with ''kvm'') it produced lots of //"nic memory corrupt"// errors and network performance is painfully slow (network install is like going back to the modem days :-P) (Inside FreeBSD they're named ''edX'') \\ HVM default (rtl8139?) works fine (Inside FreeBSD named ''reX'') ===== Real hardware install ===== Since I won't be using it and will reside in an external disk I won't be integrating it into my system (boot loader, etc). I'll use the BIOS-builtin boot disk selector. Here are the abridged steps/progress in its installation. This is very specific to my needs and mainly useful to myself, I recommend you follow the (much clearer) [[http://www.freebsd.org/doc/handbook/install.html|FreeBSD handbook instructions]]. Main reference: http://www.freebsd.org/doc/handbook/install.html * Pre installation: * Disk layout: I'll partition the disk into ~20GB pieces, so that I can install other alternate OSes; with ''cfdisk'' from Linux. * I'll be installing in /dev/sdX2. /dev/sdX1 will be reserved for some variation of Linux and GRUB, probably * Source: I'll be using an ISO from ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/. I'll be using 8.0-RELEASE, CD-Disc 1 * Note! Up until now I've been using FreeBSD 7.1-RELEASE for my tests. * I'll be converting the ISO into an FTP hierarchy * I've already FTP setup (ProFTPd) but no anonymous access is allowed. Enabled with: <code> <Anonymous ~ftp> User ftp Group nogroup UserAlias anonymous ftp RequireValidShell off DirFakeUser on ftp DirFakeGroup on users <Directory *> <Limit WRITE> DenyAll </Limit> </Directory> </Anonymous> </code>\\ Symlinks won't be able to escape the root jail so hardlinks or ''mount %%--%%bind'' are required. * ISO temporarily accessible as ''<nowiki>ftp://SERVER/freebsd/</nowiki>'' : <code># cd ~ftp # mkdir freebsd # mount -o loop PATH_TO_ISO ~ftp/freebsd </code>\\ Now can install by setting FTP as media, choosing //Other// as site and putting the ftp path ([[http://www.freebsd.org/doc/handbook/install-diff-media.html#INSTALL-FTP|source: handbook]]) * Since I decided a long time ago to stop using blank discs whenever possible, I'll be starting the installation from USB. <del>To make things as hard as possible</del> Since all my USB sticks are full of crap right now I'll be using an SD card and a multi-slot card reader.\\ The quick and dirty way will be to use [[http://unetbootin.sourceforge.net/|unetbootin]] to make a bootable USB disk. After a lot of trial and error I found out it's better to let unetbootin download the iso and format the SD card as FAT (it failed with an external iso and/or ext2). * A couple times in the past I disabled other disks so that the OS saw its disk as the first one, which worked great for Windows; but the BIOS in my current motherboard is a mess and I'm unable to do this. * Installation begins * Installation * Let's see if I don't wipe the wrong disk :P * Trial & error and... ''ad14'' matches the fdisk I just run while on Linux. sysinstall's ''fdisk'': * Delete all slices (the disk is empty anyway) * Create slice, 20480M, 131 (ext2fs) => ad14s1 * Create slice, 20480M, 165 (FreeBSD) => ad14s2 * Finish * BootMngr on ad14 * BSD disklabels => Auto layout * Finish * Packages: Minimal + User + Custom: lib32 * FTP site by URL * Go! * sysinstall was unable to find any FTP site (although I could ping them just fine) and when they worked writing to disk failed. I went ahead with the install and was able to boot it. Once booted I re-run ''sysinstall'' to install any missing stuff and it worked. * Both Linux and Windows have survived unharmed. * Time to fix the installation... * Re-running ''systinstall''... //install additional distributions//... local FTP. This time it appears to work. * Installation details: * Network card is ''re0'' * First user UID was 1001. Set it to 1000. * Root has no password (due to the initial installation problems) * Let's start installing packages I'll need to work on ''[[http://p.outlyer.net/dox/vcs|vcs]]''((bash3 would be more appropriate but v4 is the default)) and ''[[http://p.outlyer.net/dox/mp3plot|mp3plot]]'' (with ''sysinstall'', Configuration -> Packages -> FTP -> (remote site) or ''pkg_add -r''): * <code># pkg_add -r bash mplayer ffmpeg vim subversion # pkg_add -r xorg gnome2</code> * Everything is fine. Only gripe: No nvidia driver yet (which I already knew) but that means the stupid fan is always at max and driving men uts.\\ Anyway, time to install i386 version. i386 time. This should be easier now I've seen some pitfalls. I will be using remote FTP from the start this time around. * unetbootin... * boot from SD card... * First tricky part: partitioning. I'll have to use first partition this time; should have learned about BSD disklabels and layouts before :-P. If I ever install an alternate linux in this disk, it can be installed anywhere else. \\ ad14s1. Delete all ad14s2 disklabels from the list. Auto disklabels: <code> ad14s1a / (512M) ad14s1b swap (4G) ad14s1d /var (4G) ad14s1e /tmp (512M) ad14s1f /usr (11G)</code> * Minimal+User * FTP, nearby site * DHCP, manual hostname * DNS failed. I'll be pinging my choice next time. Choose one that responds and... fail! **aaaargh** WTF? Switch to repair shell. * What, is it broken? http://forums.freebsd.org/showthread.php?t=2087. * Changing DNS didn't help * This installer **needs** some love. Let's try rebooting. * Reboot: * fdisk, disklabel, User, FTP, main site... and now it works. :? ===== System configuration ===== * Add normal user to ''wheel'' group to allow issuing ''su'' ((http://www.cyberciti.biz/faq/freebsd-add-a-user-to-group/)) <code># pw usermod myuser -G wheel</code> * Switch default user's shell to bash: <code>$ chsh -s $(which bash)</code> * Install desktop environment:<code># pkg_add -r xorg gnome2</code> * Enable it:<code>echo 'gnome_enable="YES"' >> /etc/rc.conf</code> * (i386 only) nVidia driver * Install kernel source tree((http://www.freebsd.org/doc/books/handbook/kernelconfig-building.html)) to allow compilation of nVidia module:<code># sysinstall</code>''Configure'' => ''Distributions'' => ''src'' => ''base'' and ''sys'' * Build it:<code># cd /usr/ports/x11/nvidia-driver # make install # Linux compat. Disabled</code> * Load at boot ((http://www.freebsd.org/doc/en/articles/compiz-fusion/nvidia-setup.html)):<code># echo 'nvidia_load="YES"' >> /boot/loader.conf</code>Reboot ((Can also load it with ''# kldload nvidia'' but Xorg might choke)). * Enable it in xorg.conf * No xorg.conf? Create a skeleton one IF REQUIRED: * Stop X <code># /usr/local/etc/rc.d/gdm stop</code> * Create skeleton xorg.conf ((http://www.freebsd.org/doc/handbook/x-config.html)) <code># Xorg -configure</code> test it with <code># X -config /root/xorg.conf.new -retro</code>Only kept relevant sections (''Device'' and a modified ''Screen'') * Install it <code># cp xorg.conf.new /etc/X11/xorg.conf</code> * Small tricks: * Fix arrow keys in vim: <code>$ touch ~/.vimrc # The existance of ~/.vimrc is equivalent to ":set nocompatible"</code> * Common tools not installed by default: <code># pkg_add -r ImageMagick wget vim fusefs-kmod fusefs-sshfs</code> * Enable fuse((''# kldload /usr/local/modules/fuse.ko'')) and allow normal users to mount * <code># echo fusefs_enable="YES" >> /etc/rc.conf # sysctl vfs.usermount=1 </code> ===== Upgrading ===== **untested yet** FIXME: Is there any safe way of live-upgrading? Is ''/sbin/sysinstall'' + Config -> Options -> Release name change discouraged? * Download bootonly ISO * Keep note of partitioning scheme, will be needed * Boot into bootonly ISO's ''sysinstall'' * Run upgrade

freebsd/installation.1267931731.txt.gz · Last modified: 2010/03/07 03:15 by Toni Corvera
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki