Author Archive

ZFS Cant rm: No space left on device

If you completely fill up a 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 . what I did:


# df -h
     Size    Used   Avail Capacity  Mounted on
themirror       39G     39G      0B   100%    /home/jacob/themirror
# rm 3gfile
rm: 3gfile: No space left on device
#  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

FreeBSD error in /boot/loader.conf

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

#/boot/loader.conf
.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.

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

uses udev. Udev handles mapping MAC’s to the appropriate /dev/(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 .
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)

Karmic install cannot login (gdm freezes) Nvidia

On a fresh of , using an 7800 GT. When I went to click on my username to log in, some artifacts would appear on the screen, then the system would freeze. hard. Couldnt even ctrl+alt to another console. Installing the fixed the issue. To fix it:

  1. Do a hard reset on the machine
  2. When you arrive at the screen, DO NOT CLICK ON ANYTHING.
  3. press CTRL + ALT + F5. Your screen will switch over to a text console.
  4. Log in.
  5. Install the Nvidia glx
  6. sudo aptitude install nvidia-glx-new
  7. Reboot the machine.
  8. sudo reboot

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 . you can test for %programFiles(x86)%, but handling the output and writing the IF comparisons is messy.

In , 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% ==  echo This is a 64-bit version of windows
IF %processor_architecture% == x86 echo this is a 32-bit version of windows.
pause