Category > FreeNAS

FreeNAS CIFS/Samba changing Guest Account ‘FTP’ not working

gimpe » 18 December 2009 » In FreeNAS, tips » No Comments

Using FreeNAS 0.7 Khasadar (revision 4919) with CIFS/SMB Authentication Anonymous, I changed the Guest account for but it is not actually applying it to the configuration, it is a trivial bug and here’s a small dirty workaround.

1 – Create an excutable file containing this:

#!/bin/sh

# find and replace 'ftp' by 'transmission'
sed -i. 's/ftp/transmission/g' /etc/rc.d/samba

# restart samba to use the new config
/etc/rc.d/samba restart

2 – Go in System|Advanced|Command scripts and add an entry for your script in “PostInit”

For those who are interested, I am doing this because my network is not accessible from the outside and I didn’t want to bother with user privileges. I am using my FreeNAS box to share media files downloaded using Transmission and I wanted everybody to be able to access/modify/delete them, so I change the guest account to be “transmission” :)

Continue reading...

Tags:

FreeNAS: Services|UPS –> what to use as “Port”

gimpe » 13 October 2009 » In FreeNAS » No Comments

I’m writing a note to myself as I don’t have a UPS yet :)

The Port value can be set to “auto” as metionned here: http://jonathanbrown.me/my-freenas-project-part-5-the-config

Found another rerefence that confirms this:
- For newhidups: “auto” or whatever value as newhidups automagically probe for USB UPS.

SOURCE: http://people.freebsd.org/~thierry/nut_FreeBSD_HowTo.txt

Continue reading...

Tags:

Diskless HTPC using DD-WRT (PXE), Ubuntu/XBMC and FreeNAS (TFTP, NFS)

gimpe » 20 September 2009 » In FreeNAS, htpc, hype, linux, network » 2 Comments

Given that I spent time and money on my FeeNAS node, I want to maximize its usage, so when a friend told me that I can use PXE and NFS to boot a diskless computer from the network, I thought it was the perfect opportunity to try somehing new and activate some more services under FreeNAS!

Continue reading...

Tags: , , ,

FreeNAS Bash script to start a ZFS scrub on each pool (scrub.sh)

gimpe » 28 August 2009 » In FreeNAS, bash » 6 Comments

This script will start a scrub on each ZFS pool (one at a time) and will send an e-mail or display the result when everyting is completed. I wrote this script to launch each scrub one after the other and a summary by e-mail that can tell me how much time it took to each ZFS scrub.

Continue reading...

Tags: ,

Useful tools in an “embedded” FreeNAS: wget and bash

gimpe » 04 August 2009 » In FreeNAS, bash » No Comments

wget

To install wget on a “data” parition:

export PKG_TMPDIR=/mnt/usb-data/temp
pkg_add -r wget -P /mnt/usb-data/pkg

Now we need a script to create the symlinks to the wget binaries in the “pkg” directory:

nano /mnt/usb-data/hooks.sh

Here’s the content:

#!/bin/sh

ln -s /mnt/usb-data/pkg/bin/wget /bin/wget

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!

bash

For bash, add this in the “hooks.sh” script:

# .bashrc for root
ln -s /mnt/usb-data/bashrc /root/.bashrc

# .bashrc for regular user
ln -s /mnt/usb-data/bashrc /mnt/.bashrc

# automatically load bash for root on login (not clean but works)
echo "bash --init-file /mnt/usb-data/bashrc" >> /root/.cshrc

# automatically load bash for regular user on login (not clean but works)
echo "bash --init-file /mnt/usb-data/bashrc" >> /mnt/.cshrc

Continue reading...

Tags: ,

Vim (Vi IMproved) in an “embedded” FreeNAS

gimpe » 03 August 2009 » In FreeNAS, bash » 3 Comments

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!

Continue reading...

Tags: ,

My FreeNAS/FreeBSD configuration on D945GCLF2 / Atom 330 VS “panic spin lock held too long”

gimpe » 09 July 2009 » In FreeNAS » 2 Comments

UPDATE 2010-05-20
I am now running 0.7.1 Shere (revision 5127) since 1 month with Hyperthreading enabled and I had no issue. It seems to be fixed.

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:

  1. Resetted the Bios to default settings (I had turned OFF many things before)
  2. Installed using full install amd64 (I was using an embedded install before)
  3. System -> Advanced -> activated Power Daemon
  4. Network -> LAN -> activated Device Polling
  5. 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

Continue reading...

Windows Backup using rsync and DeltaCopy

gimpe » 18 February 2009 » In FreeNAS, bash » No Comments

newrsynclogo

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/

Continue reading...

Tags: