Izumi Blog: Ralf - Free Bsd Tips
Index: Home | What Is Izumi | Linux Tips | OpenBSD Tips | FreeBSD Tips
This page contain several tips for using FreeBSD. I use this mostly as reminders of commands that I found useful. There's generally nothing here one couldn't learn by searching on the net or reading the man pages, which is generally how I got the commands in the first place.
Site License And Disclaimer as well as contact information are available here.
$Id: Free Bsd Tips.izu,v 1.11 2006-12-25 02:58:50 ralf Exp $

«»  2006/12/22 «» Corrupted FS  «»

Weird. So I tried to mount the already mounted CD-ROM (or something similar, not quite sure what). Eventually I do an ls /cdrom/blah and boom: kernel panic and reboot.

Turns out ufs complains about a corrupted inode in /tmp. A bit too fragile if you ask me.

Anyway, the point is to learn so here's what I'm doing:

Now that I have a prompt in single-user mode let's poke around:

	# df -ah
df tells me that /dev/ad0s1a is mounted on /.
	# mount -a
Hmm so here I learn that / was mounted R/W and it's not clean. All partitions were not properly dismounted (well that's the kernel panic right there). And /tmp is on /dev/ad0s1e. So let's try this:
	# umount /tmp
	# fsck /dev/ad0s1e
Or let's be more radical:
	# umount /usr
	# umount /var   # and whatever else is mounted except 
# fsck -y # check all available filesystems with auto-yes # mount -a # no errors # df -ah

OK that solves. However it's a bit freaking that the file system got corrupted so easily in the first place.

What, no journaling in the default filesystem? would I hear? Apprently the "solution" choosen by FreeBSD is soft updates instead of journaling. More detais on UFS here (a.k.a. Unix FS, BSD FFS, etc.)

[permalink]


«»  2006/12/22 «» Live CD  «»

LiveCD:

	$ sudo pkg_add -r livecd
	$ cd /usr/local/livecd
	$ sudo mount /cdrom
	$ sudo sysinstall
	> Configure > Distribution
	$ sudo ./livecd.sh
	> Language: English
	> Livecd.sh is running from: /usr/local/livecd
	> Create LiveCD's / in /usr/live_root
	> Create LiveCD.iso in /usr
	> Not an install media
	> No CD burner in this machine but I have a CDR
	> My CD device is /dev/acd0

... and then it all breaks. Turns out this is from 2003 and targets a 4.x or 5.x release of FreeBSD. Doesn't work on 6.1-Release.

Conclusion: Want a LiveCD? Just use FreeSBiE.

[permalink]


«»  2006/12/22 «» Ports  «»

Settings up the ports system on an already installed system, typically if you dismissed the fact during the update:

[permalink]


«»  2006/12/22 «» Sudo, wheel, bash  «»

So first thing first:

	# pkg_add -r sudo

Now edit the sudoers and allow the wheel group to run all commands:

	# vim /usr/local/etc/sudoers
	...
	# Uncomment to allow people in group wheel to run all commands
	%wheel  ALL=(ALL)       ALL
	:wq

OK now our default user should be created using its own group. We also want it part of the wheel. This is explained in the handbook about groups. pw groupmod is what you need but the trick is that groupmod will set the complete group list, so you need to list the content of wheel first and add yours. I find that a bit odd and a tad dangerous. Anyway it works like this:

	# pw groupshow wheel
	wheel:*:0:root
	# pw groupmod wheel -M root,ralf
	# su - ralf
	$ sudo pw groupshow wheel
	wheel:*:0:root,ralf

The id comand is useful to list current membership:

	$ id
	uid=1001(ralf) gid=1001(ralf) groups=1001(ralf), 0(wheel)

Finally let's set bash as the default for my user:

	$ sudo vipw
	/ralf
	s@/bin/sh@/usr/local/bin/bash
	:wq

[permalink]


«»  2006/12/21 «» So what's next?  «»

[permalink]


«»  2006/12/21 «» Laptop Compatibility  «»

Sounds like I should really give it a try on my PCG-R505.

And this will be most useful:

[permalink]


«»  2006/12/17 «» Packages  «»

Packages:

Even if you don't want to use ports, there's a benefit in having a fully up-to-date ports collection to quickly find what exists using whereis.

Another way is to do

	$ fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/INDEX
and grep it there after:
	$ grep sudo INDEX
but the output is rather ters.e Or simply do this as root:
	$ pkg_add -r sudo
which will fetch sudo remotely and install it if found (or let you know it's not been found with a rather cryptic message.)

So let's do the usual:

	# pkg_add -r sudo
	# pkg_add -r vim
	# pkg_add -r screen  # not found
I already had bash and rsync installed via sysinstall.

For a port-based approach, here are some interesting tips:

[permalink]


«»  2006/12/17 «» Minimal Install  «»

Let's apply what I found with OpenBSD. The OpenBSD install was really terse. This one at least is menuconfig-like (i.e. text-based dialog boxes as in Debian 3.0) with lots of sensible defaults.

Vocabulary: slices and partitions are defined in the handbook on how to add disks. A slice is one of the four BIOS partitions that PC drives can have. Partitions are logical BSD partitions living inside a slice.

Install:

And voila, a rather painless install.

So what do we have now?

$ uname -a
FreeBSD freebsd.of.nine 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May  7 04:32:43 UTC 2006     root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

$ df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad0s1a    496M     34M    422M     8%    
devfs 1.0K 1.0K 0B 100% /dev /dev/ad0s1e 496M 12K 456M 0% /tmp /dev/ad0s1f 13G 193M 12G 2% /usr /dev/ad0s1d 1.2G 968K 1.1G 0% /var

[permalink]


«»  2007/09/30  «»

OK I'm done here. Let's move on to OpenBSD.

[permalink]


«»  2006/06/25 «» ports  «»

Getting ports:

# portsnap fetch
# portsnap extract
# portsnap update

Getting a specific port:

# whereis bash
# whereis bash
bash /usr/ports/shells/bash
# cd /usr/ports/shells/bash && make install
# cd /usr/ports/security/sudo && make install

[permalink]


Blog Archives:
Most recent posts
2006/06/25 - 2006/06/25
[RSS]


Site License

Creative Commons License
This work is licensed by Raphaël Moll under a Creative Commons License.

Options
Color Theme: Gray  | Blue  | Black | Sand  | Khaki  | Egg  | None

Web ralf.alfray.com Powered by Google

Display Izumi & PHP Credits

Stats
1615 accesses, 1 access from 38.107.191.98
Visited 127 times by Google, last 2010/03/06 13:37
Visited 229 times by Yahoo!, last 2010/03/09 15:08
Visited 1 times by Alexa, last 2009/02/23 03:39
Visited 29 times by Teoma, last 2009/11/02 04:53
Visited 165 times by MSN, last 2010/03/06 11:30

< Generated in 0.46 seconds the 03/11/2010, 05:40 AM by Izumi 1.1.4 >