You need an embedded install with a data partition. My FreeNAS server runs from a 1GB usb stick and the data partition is mounted as “/mnt/usb-data”. To install Vim on the usb stick:
# using csh
setenv PKG_TMPDIR /mnt/usb-data/temp
# install package
pkg_add -r vim-lite -P /mnt/usb-data/pkg
Now we need a script to create the symlinks to the Vim binaries in the “pkg” directory:
nano /mnt/usb-data/hooks.sh
Here’s the content:
#!/bin/sh
# Vim symlinks to binaries
ln -s /mnt/usb-data/pkg/bin/vim /bin/vi
ln -s /mnt/usb-data/pkg/bin/vim /bin/vim
# .vimrc for root
ln -s /mnt/usb-data/pkg/share/vim/vim72/vimrc_example.vim /root/.vimrc
# .vimrc for regular user
ln -s /mnt/usb-data/pkg/share/vim/vim72/vimrc_example.vim /mnt/.vimrc
# syntax file
mkdir /usr/local/share/vim/
mkdir /usr/local/share/vim/syntax/
ln -s /mnt/usb-data/pkg/share/vim/vim72/syntax/syntax.vim /usr/local/share/vim/syntax/syntax.vim
Now make it run at boot time, go in System —> Advanced —> Command scripts and enter:
/mnt/usb-data/hooks.sh
Select PostInit and that’s it! Everytime you reboot your FreeNAS server the symlinks will be re-created!
Posted in: FreeNAS, bash.
vi /etc/init.d/1000Mbs
#!/bin/sh
ETHTOOL="/usr/sbin/ethtool"
DEV="eth0"
case "$1" in
start)
echo -n "Setting eth0 speed 1000 full-duplex...";
$ETHTOOL -s $DEV speed 1000 duplex full autoneg on;
echo " done."
;;
stop)
;;
esac
exit 0
update-rc.d 1000Mbs defaults
SOURCE: http://www.cyberciti.biz/tips/howto-linux-add-ethtool-duplex-settings-permanent.html
Posted in: bash, linux, network.
1 – Compile and install driver:
Source: http://wiki.cchtml.com/
[cci lang="bash"]sudo aptitude install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms
sh ati-driver-installer-9-7-x86.x86_64.run –buildpkg Ubuntu/jaunty
sudo dpkg -i xorg-driver-fglrx_*.deb fglrx-kernel-source_*.deb fglrx-amdcccle_*.deb[/cci]
2 – Generate base xorg.conf:
[cci lang="bash"]sudo aticonfig –initial=dual-head
sudo aticonfig –dtop=horizontal[/cci]
Note: you can do “dpkg-reconfigure xserver-xorg” to reset you xorg.conf to default values.
3 – Log out and log in to use the new xorg.conf
4 – Activate multi-screen & compiz:
Source: http://www.uluga.ubuntuforums.org/showthread.php?p=7552538
Start ATI Catalyst Control Center as root:
[cci lang="bash"]sudo amdcccle[/cci]
Now, go in Display Manager -> Multi-Display -> Big Desktop right fo display 1
Then start compiz: System -> Preferences -> Appearence -> Visual Effects
Posted in: linux.
UPDATE 2009-09-03
Still running without any issues :)
UPDATE 2009-08-01
Re-installed FreeNAS this weekend and the problem didn’t come back!
Disabling Hyperthreading fixed it!
UPDATE 2009-07-26
Disabling Hyperthreading in the Bios seems to do the trick, I haven’t yet got the error again, I am crossing my fingers.
UPDATE 2009-07-21
Now I am trying to disable Hyperthreading to see if my problem will go away, stay tuned.
ORIGINAL POST
I had some “panic spin lock held too long” problem, my FreeNAS box was freezing without any reasons.
Here’s what I did:
- Resetted the Bios to default settings (I had turned OFF many things before)
- Installed using full install amd64 (I was using an embedded install before)
- System -> Advanced -> activated Power Daemon
- Network -> LAN -> activated Device Polling
- Network -> LAN -> Type 1000baseTX / Full-Duplex
And since then no more “panic spin lock held too long”.
Unfortunately, the problem came back :( It seems to be related to when I leave mounted shares on my Ubuntu dektop for a long period without activity. I re-installed my NAS directly with FreeBSD/Samba and the same problem happened again.
Interesting feed: http://lists.freebsd.org/pipermail/freebsd-stable/2009-July/thread.html#51019
Posted in: FreeNAS.
1 – Compile and install driver:
Source: http://wiki.cchtml.com/
[cci lang="bash"]sudo aptitude install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms
sh ati-driver-installer-9-6-x86.x86_64.run –buildpkg Ubuntu/jaunty
# i386
sudo dpkg -i xorg-driver-fglrx_*.deb fglrx-kernel-source_*.deb fglrx-amdcccle_*.deb
# AMD64
sudo dpkg -i xorg-driver-fglrx_*.deb fglrx-kernel-source_*.deb fglrx-amdcccle_*.deb[/cci]
2 – Generate xorg.conf:
[cci lang="bash"]sudo aticonfig –initial=dual-head –screen-layout=right
sudo aticonfig –dtop=horizontal –overlay-on=1
sudo aticonfig –xinerama=on[/cci]
Note: you can do “dpkg-reconfigure xserver-xorg” to reset you xorg.conf to default values.
3 – Bug workaround:
Source: http://jen3ral.wordpress.com/
- Login to a tty (ctrl+alt F1) and type sudo killall gdm.
- Type sudo nano (or gedit, whichever you prefer) /etc/ati/amdpcsdb to edit the file. Go to the [AMDPCSROOT/SYSTEM/DDX] section and add:
[cci lang="bash"]EnableRandR12=Sfalse.[/cci]
- Type this into a terminal, sudo nano (or gedit) /etc/X11/xorg.conf, to open the xorg.conf file.
- Under the “Device” section add these options on separate lines:
[cci lang="bash"]Option “EnableRandR12″ “false”
Option “DesktopSetup” “horizontal”[/cci]
- Now just restart your computer and it should be good to go.
Compiz still not working…
Posted in: linux.
When you add a new network card in your linux box and remove the old one, the new card will be named eth1. If you want to change it back to eth0, you can edit the file “70-persistent-net.rules” to remove the old eth0 card line and also remove the new eth1 line:
[cci lang="bash"]vi /etc/udev/rules.d/70-persistent-net.rules[/cci]
Then you just need to reboot and the file will be updated with the new network card as eth0.
Posted in: linux.
dpkg-reconfigure exim4-config
Choose: “mail sent by smarthost; received via SMTP or fetchmail”
Posted in: linux.
Get root access:
[cci lang="bash"]sudo su[/cci]
To backup:
[cci lang="bash"]tar cvpzf backup.tgz –exclude=/proc –exclude=/lost+found –exclude=/backup.tgz –exclude=/mnt –exclude=/sys /[/cci]
To restore:
[cci lang="bash"]tar xvpfz backup.tgz -C /[/cci]
Source: http://ubuntuforums.org/showthread.php?t=35087
To backup on an other mount:
[cci lang="bash"]tar cvpzf /mnt/data/backup.tgz –exclude=/proc –exclude=/lost+found –exclude=/mnt –exclude=/sys /[/cci]
Posted in: linux.

Use DeltaCopy (as rsync server) on the Windows box:
http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp
You’ll need to open port TCT/873 in your windows firewall.
Note: To fix the accentuated characters issue in the filenames, you can replace the “Cygwin1.dll” in the DeltaCopy directory by a UTF-8 compliant Cygwin dll (http://www.okisoft.co.jp/esc/utf8-cygwin/). Then restart the service or reboot.
And here’s my bash script running on my Linux box (all the files are in a “backup-tools” directory):
#!/bin/bash
passwdfile=~ACCOUNT/backup-tools/passwd
excludefile=~ACCOUNT/backup-tools/exclude
options="--delete-after --recursive --exclude-from=$excludefile --human-readable --stats --times"
# This gives a bored user something to watch
if [ "$1" = "--progress" ];
then
options="$options --progress"
fi
echo "--starting--"
rsync OPTIONNALUSERNAME@SEVERADDRESS::DELTACOPYMODULENAME /WHERETOBACKUP --password-file=$passwdfile $options
echo "--done--"
Then I run it daily in the crontab (command “crontab -e”):
@daily ~ACCOUNT/backup-tools/rsync.sh | mail ACCOUNT -s "daily rsync result"
Ref: http://dailycupoftech.com/windows-backup-with-rsync-and-freenas/
Posted in: FreeNAS, bash.