home | tech | misc | code | bookmarks (broken) | contact | README


NetBSD tips

Adding a Linux partition and making it appear in the disklabel

You can easily add a Linux partition to your HD using the fdisk(8) program, or using a Linux partition program during your distro installation. They will not show up automatically in the disklabel(8), in NetBSD, but they will appear when using the mbrlabel(8) and fdisk(8) commands.

To update disklabel according to mbrlabel, type the following command:

# mbrlabel -rw wd0

Mount pen-drive (USB stick)in NetBSD

USB pendrivers are usually attached to the sd* devices. To get the exactly location what devices are active and can be mounted, type:

$ dmesg | tail

This will output the current disks. The pendrive will be one of the sd* devices. To discover the exactly device where it is attached, run disklabel on it:

# disklabel sd0

Then, mount the device:

$ mount -t msdos -o -l  /dev/sd0e mnt/pendrive/

A reference here.

Suspend/resume in amd64

In i386 we used to have apm(8) and zzz(8) to enter suspend mode. In amd64 it is:

# sysctl -w hw.acpi.sleep.vbios=2
# sysctl -w hw.acpi.sleep.state=3

Unfortunatelly it is not well documented at the time I write this tip.

The documentation for these sysctl variables are in acpi(4).

Thanks medfly@freenode for this tip.