![]() |
|
|
|
|
|
Getting started with FreeBSD
By Aditya Kulkarni <Aditya@freeos.com>
FreeBSD has a major as well as a minor release. For instance the 4.1 Release has major release as 4 and minor release as 1. By default like Linux or any UNIX clone, users have to be created on the system, as it is dangerous running as root all the time. After installation, it asks whether you want to create users or not. Get into the FreeBSD system installer by changing to the stand directory and by typing sysinstall. cd /stand ./sysinstall Here in this setup, like configuration manager, you can configure time zone, mouse, console fonts, screensavers, network, additional packages and other things. To configure X server and X Desktop, the sysinstall program is an easy-to-use GUI-based tool. All you have to do is install the necessary packages needed for X server, fonts, libs etc. And choose the XF86Setup option, which is fully graphical and easy to use. All you have to know is the kind of video card you have. You need to have a X Desktop like Window Maker, AfterStep, GNOME or KDE. Choose whichever window manager you need. If you haven't installed the FreeBSD handbook,you can do that using the sysinstall program. The handbook location is /usr/share/doc/handbook. Now you have a ready FreeBSD box to use. If you have the complete FreeBSD set of 4 cdroms, you can install all the packages, which includes games, security tools, word processors, development tools, applications etc. FreeBSD also supports binary compatibility with Linux. You can run Linux programs on FreeBSD. That can be enabled using the Startup option in the sysinstall program. For advanced configurations like kernel compilation, Firewalls, etc you can refer to the handbook. By default the shell for root is csh. Choose the configure option followed by the User Management, where you add users and groups. After creating users, it will ask for the shell for the users. Choose bash (easiest Shell in FreeBSD). Assuming that you have installed bash, now login as the unprivileged user (non-root) and create. bashrc and .bash_profile files in the home directory. Edit these files to contain the following. In .bashrc put these statements. # .bashrc - Bourne Again Shell configuration file # for interactive shells. # file permissions: rwxr-xr-x umask 022 BLOCKSIZE=K; export BLOCKSIZE EDITOR=pico; export EDITOR PAGER=/usr/bin/more; export PAGER # some useful aliases alias h='fc -l' alias j=jobs alias m=$PAGER alias ll='ls -laFo' alias ls='ls -la -G' alias g='egrep -i' alias ll='ls -laFo' alias ls='ls -la -G' alias g='egrep -i' # set prompt PS1="u@ w $> " Now for .bash_profile put the following statements: # .bash_profile - Bourne Again Shell configuration file # for login shells. PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin: # file permissions: rwxr-xr-x umask 022 BLOCKSIZE=K; export BLOCKSIZE EDITOR=pico; export EDITOR PAGER=/usr/bin/more; export PAGER # set ENV to a file invoked each time bash is started # for interactive use. ENV=$HOME/.shrc; export ENV # some useful aliases alias h='fc -l' alias j=jobs alias m=$PAGER alias ll='ls -laFo' alias ls='ls -la -G' alias g='egrep -i' # set prompt PS1="u@w $> " The above line sets the prompt like this: addy@ ~ $> When you change directory to the following cd /usr/bin, it looks like: addy@ /usr/bin $> You can also make changes in these files to alter the editor option, as people have their own favourite editors like vi, emacs, pico etc. Also add the following to your .login file in your home directory exec /bin/bash. Here my bash is symbolically linked to /usr/local/bin/bash. Login after that to get bash running . Now whenever a user (non-root ) wants to use a system administrator command or perform tasks that can be done only by root, he has to `su to root' using the `su' command. In order to be a super user (root), the user must be member of group wheel. Normally this is done when you add a user or put the username at the end of the line containing wheel :*: 0: root in /etc/group. For eg. if user addy is a member of the group wheel. wheel:*:0:root,addy So addy is able to `su to root'. Now is the time for accessing floppy disks. How does one use a floppy disk in FreeBSD? Answer: Use the fdformat, mount, newfs commands to use a floppy disk. For formatting a floppy in this OS, run the following command: #fdformat -n /dev/rfd0 Now you have a label to the disk that you have formatted. You can do this by using the disklabel command. #disklabel -w -r /dev/rfd0 fd1440 For creating a new filesystem on the floppy, use the newfs command as: #newfs /dev/rdf0 This creates the ufs file system on the floppy. Mount the floppy using the mount command, but first create a target directory for floppy in /mnt as /mnt/floppy. #mount /dev/fd0 /mnt/floppy You can also create MS DOS file systems on the floppy disk using mkdosfs command #mkdosfs -f 1440 /dev/rfd0 Similarly for mounting cdroms just do a mount /cdrom . For configuring sound drivers (FreeBSD does not install it by default) you have to compile the kernel, (see the handbook for more details about kernel compilation and your sound card). FreeBSD comes with a complete set called distribution set, for source code and is installed under the /usr/src directory. Here, you can perform what is called as a "make world". Do a make world here, which incidentally, takes a long time . You can also do a make buildworld, make installworld, which does the above make world. What this does is that it compiles and rebuilds everything, removes the old build directories and creates new ones. It rebuilds and installs the make, the `C' compiler and the libraries. But note that it does not compile the kernel. If you get stuck somewhere or encounter problems while configuring, the FreeBSD handbook is a good guide to refer to.
Other articles by Aditya Kulkarni
Current Rating: [ 6.32 / 10 ]
Number of Times Rated: [ 113 ]
|
|
|
© 1998-2004 FreeOS Technologies (I) Pvt. Ltd. All rights reserved.
[Privacy Policy]
![]() |