Tagged: freebsd

FreeBSD: zzz command

While I was researching on suspend/resume capability for FreeBSD on my notebook, I came across with the zzz command. Guess, what it does! It puts the system in the sleep mode (zzz(8)).

Similar command for APM is:$ apm -z

For ACPI:$ acpiconf -s3

In the FreeBSD wiki page for Laptops, it asks to boot up a laptop with a FreeBSD CURRENT image and gathers some hardware info with the following commands: # mount -u -o rw / # dmesg > /dmesg.out # pciconf -lv > /pciconf.out # devinfo -v > /devinfo.out # acpidump -dt > /acpidump.out # mount -u -o ro / ; sync # zzz

Maybe, I'll give those commands a try next time when I go to a store...

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

That's all!
-gibb

FreeBSD: Disabling System Bell/Beep (Hardware Bell)

One of annoying things with notebook is the beep when you hit a wrong key. This is a way to disable system beep/bell.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

This is a recommended way to disable it but it did not work for me.# sysctl hw.syscons.bell=0 hw.syscons.bell: 1 -> 0 # sysctl -a | grep bell hw.syscons.bell: 0

Here is another way that worked for my HP Pavilion dm3-1130us notebook. Try this on a console and see if it disables a beep:# kbdcontrol -b quiet.off

If this works, make it permanent by editing /etc/rc.conf: # vim /etc/rc.conf ---------------------------------- allscreens_kbdflags="-b quiet.off"

That's all!
-gibb

FreeBSD: Displaying Installed video Driver

A few days ago, I was finally able to install FreeBSD 11-RELEASE on my HP Pavilion dm3-1130us notebook (see FreeBSD: gptzfsboot: No ZFS pools located, can't boot on FreeBSD 11-RELEASE) and started configuring it. Then, time to time, I needed to find the installed video driver for my system. So, here is the command: $ pciconf -lv | grep -B3 display vgapci@pci0:1:5:0 class=0x030000 card=0x3656103c chip=0x96121002 rev=0x00 hdr=0x00 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'RS780M [Mobility Radeon HD 3200]' class = display

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

That's all!
-gibb

FreeBSD: gptzfsboot: No ZFS pools located, can’t boot on FreeBSD 11-RELEASE

Last time (a few years back) when I tried to install FreeBSD with zfs on my HP Pavilion dm3-1130us notebook, I got the following error message during the boot: gptzfsboot: error 66 lba 48 error 72 gptzfsboot: error 66 lba 0 gptzfsboot: error 66 lba 1 gptzfsboot: No ZFS pools located, can't boot.

I searched around for a solution but couldn't find any so I gave up on FreeBSD.

Years after, meaning recently, I gave FreeBSD 11-RELEASE a new shot, hoping that zfs boot up problem was resolved by now. *BAM* I got the same error after installing it with zfs. For desperation, I searched again and again. Tried building partition table manually, updating bootcode after the installation, etc... But nothing worked... I even tried TrueOS (FreeBSD with zfs and more) but got the same problem after the installation. Sob...

But finally, I found a solution (sort of)!!!

Here is what I tried. I don't think the installation medium makes difference but I used a USB boot image.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Step 1) Download the FreeBSD memstick image. Find the latest release version (as of this writing, it's 11.0) from the freebsd.org ftp site.

Step 2) dd the memstick image to a USB memory stick. The USB device name could be different depending on which OS you are using, but for FreeBSD, I read somewhere that said you need to use FreeBSD to make a bootable USB memory stick. So, I installed FreeBSD 11-RELEASE with UFS and ran the command: # dd if=FreeBSD-11.0-RELEASE-amd64-memstick.img of=/dev/da0 bs=1M conv=sync

Step 3)Reboot with the USB memory stick inserted. Leave the USB memory stick attached to the notebook, rebooted the system. FreeBSD will boot and it'll present with three options; Install, Shell or Live CD. I chose Install.

Step 4) Install the system but at the partitioning, choose Auto ZFS:

Here is the zfs configuration:

Step 5) Go through the rest of the installation until it asks you for the last manual configuration. Select Yes to update gptzfsboot and bootdcode:

Step 6) Get the updated gptzfsboot_hp from the FreeBSD Bugzilla. The url is listed in Allan Jude at Comment 29. If you are not configured its networking, enable dhcp client: # dhclient re0

Then download gptzfsboot_hp by fetching from the location # fetch --no-verify-peer http://trooper.hml3.scaleengine.net/gptzfsboot_hp

Step 7) Rename gptzfsboot_hp to gptzfsboot and move it to /boot.

Step 8) Update the bootcode. Make sure you are using /boot/pmbr for the GPT partition type: # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

Step 9) Make sure the partition scheme and it's for the ada0 disk. Occasionally, its disk ID is changed to something like diskid/DISK-.... If this happens, use that disk name/id instead of ada0 at the Step 8.

Step 10) Reboot the system.

After the reboot, you would see the prompt for GELI Passphrase. However, this solution solved the boot up problem with ZFS. I still see the error 66 with lba: gptzfsboot: error 66 lba 48 error 72 gptzfsboot: error 66 lba 0 gptzfsboot: error 66 lba 1 GELI Passphrase for disk0p3:

After entering GELI passphrase correctly, voilĂ , you'll see the login prompt!

That's all!
-gibb

FreeBSD 10: Mounting USB Drive with ext4 Filesystem

I have been configuring FreeBSD 10 on my HP Pavilion laptop for a while now. On and off, I tried to mount a USB drive formatted with ext4 filesystem but failed with below messages: # mount /dev/da0s1 /mnt mount: /dev/da0s1: Invalid argument # mount -t ext4 /dev/da0s1 /mnt mount: /dev/da0s1: Operation not supported by device

Hmm... the device is not available? # dmesg | grep da0 ... da0 at umass-sim0 bus 0 scbus1 target 0 lun 0 da0: <HITACHI_ DK23ES-20 00K5> Fixed Direct Access SCSI-0 device da0: Serial Number 0B02011C050FB0DC da0: 40,000MB/s transfers da0: 19077MB (39070080 512 byte sectors: 255H 63S/T 2432C) da0: quirks=0x2<NO_6_BYTE> # gpart show da0 => 63 39070017 da0 MBR (19G) 63 1985 - free - (993K) 2048 39068032 1 linux-data (19G) # ls /dev/da0* /dev/da0 /dev/da0s1

I have no idea why it's not working so I followed the handbook, 18.5. USB Storage Devices (and I also made a regular user mountable).

Edit /etc/devfs.rules to allow the operator group to be able to read and write the device: # vi /etc/devfs.rules -------------------------------------------- [localrules=5] add path 'da*' mode 0660 group operator

Then edit /etc/rc.conf to enable the devfs.rules(5) ruleset: # vi /etc/rc.conf -------------------------------------------- devfs_system_ruleset="localrules"

Next allow regular user to mount file system: # vi /etc/sysctl.conf -------------------------------------------- vfs.usermount=1

Also execute sysctl to make the update available now: # sysctl vfs.usermount=1 vfs.usermount: 0 -> 1

Create a directory which a regular use can mount to: # mkdir /mnt/ubyt3m3 # chown ubyt3m3:ubyt3m3 /mnt/ubyt3m3

Now return to a regular user and try to mount the USB drive: $ mount -t ext4 /dev/da0s1 /mnt/ubyt3m3 mount: /dev/da0s1: Invalid argument

I got Invalid argument instead of Operation not permitted but this did not resolve my original issue. Hmm... does this mean FreeBSD does not support mounting ext4 filesystem? A bit of googling found that FreeBSD supports ext2/ext3 with ext2fs type but not ext4. However, I found that FreeBSD base system comes with the fuse implementation. Indeed, there is sysutils/fusefs-ext4fuse. Let's try installing this. # cd /usr/ports/sysutils/fusefs-ext4fuse # make install clean

Well, will mounting work now? Let's see... $ ext4fuse /dev/da0s1 /mnt/ubyt3m3 fuse: failed to open fuse device: No such file or directory

So, it's still not working, huh? A further googling led me to some hints. It looks like there is a kernel module for fuse, fuse.ko, and this needs to be loaded to the kernel. # kldload fuse.ko

Lastly, edit /boot/loader.conf to load the module each boot: # vi /boot/loader.conf -------------------------------------------- fusefs_load="YES"

Now mounting USB drive with ext4 filesystem is working! $ ext4fuse /dev/da0s1 /mnt/ubyt3m3 $ ls /mnt/ubyt3m3 lost+found $

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

That's all!
-gibb