ZFS Cant rm: No space left on device

If you completely fill up a zfs pool, it wont let you delete files on it. What you CAN do, is pick a scapegoat file to wipe out or remove a snapshot. Then you will be able to use the rm command. what I did:

# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
themirror       39G     39G      0B   100%    /home/jacob/themirror
# rm 3gfile
rm: 3gfile: No space left on device
# dd if=/dev/null of=3gfile
0+0 records in
0+0 records out
0 bytes transferred in 0.000046 secs (0 bytes/sec)
# rm 3gfile
Posted in FreeBSD8, ZFS | Tagged , , , | Leave a comment

FreeBSD error in /boot/loader.conf

While experimenting with ZFS in FreeBSD, I made some tweaks to the vk.kmem_size variable in /boot/loader.conf. when setting it like this:

#/boot/loader.conf
vm.kmem_size="1024"

everything worked, but I wanted to see what would happen if i doubled it. Unfortunately, setting vm.kmem_size to 2048 kept the FreeBSD kernel from booting. At startup it would just do this:

panic: kmem_suballoc: bad status return of 3
cpuid = 0

To fix the erroneous variable setting, I had to :

1. Reboot.

2. Wait for the FreeBSD Boot menu. (the screen that lists Default, ACPI disabled, safe, and single user modes)

3. Press 6 to select “Escape to loader prompt”

4. At the loader prompt, type “show”. This will provide all the default variable settings. press the spacebar to page down. In my case, at the end, the incorrect variable was: vm.kmem_size=”2048″.

5. to switch it back and allow the system to boot, type

set (variable)=(correct value)

in my case this was:

set vm.kmem_size=1024M

6. type

boot

When you are finished with all that fun, you should edit the /boot/loader.conf file back so you don’t have to do this again.
Thanks to “crsd” from the FreeBSD IRC channel for the help.

Posted in FreeBSD8 | Tagged | 1 Comment

Debian eth0, eth1, eth2, in Virtualbox or VMware Virtual machines when copying

Debian uses udev. Udev handles mapping MAC’s to the appropriate /dev/eth(X) file. If you copy a Virtual machine, Udev will remember the MAC address of the old NIC. When you copy the machine, the virtual host usually generates a new MAC address for the VM.
Udev will assign the new Device to eth1, eth2, and so on. If you want to change your NIC assignments make Udev forget the old MAC.
In Debian 5 (lenny) it is in this file:

/etc/udev/rules.d/70-persistent-net.rules

In Debian 4 (etch) it is in this file:

/etc/udev/rules.d/z25_persistent-net.rules

To apply changes in Lenny: “udevadm trigger” or “udevtrigger” (in Etch)

Posted in Debian Etch, Networking | Tagged , , | Leave a comment

Windows 32 (x86) or 64 (AMD64) detection in batch files

While there are a lot of ways to detect for a 64 bit version of windows. you can test for %programFiles(x86)%, but handling the output and writing the IF comparisons is messy.

In Batch files, you can easily check for architecture by using the “processor_architecture” variable. x86 versions of windows will have this set to “x86″, and x64 versions “x64″. Heres an easy example:

@echo off
IF %processor_architecture% == AMD64 echo This is a 64-bit version of windows
IF %processor_architecture% == x86 echo this is a 32-bit version of windows.
pause
Posted in windows | Tagged , , , , | Leave a comment