vendredi 30 mars 2007

At Last: FreeNAS 0.684b is out

I’ve found two little bugs just before release it, but it’s not very important bug:
  • When pressing Ctrl+Alt+Del, the rc.shutdown script doesn’t work (http://pastebin.ca/417482)
  • The French accent are not correctly displayed: I’ve have the character ‘e in the place of è and ^o in the place of ô.


I’ve added the QEMU image too (excellent free virtualization tools).

I will try to debug the FreeNAS AMD64 release one day too.

Still not resolved the file permission problem (I must improve my file permission knoledge under FreeBSD before).

My 5 years old PC is dying: I will try some iMac this week-end…

mardi 27 mars 2007

File permission problem

Dan just found a bug on the 'rev 688' of FreeNAS:

Here are some command enter by a simple user (not root, not in the wheel group):

> mount
/dev/md0 on / (ufs, local)
devfs on /dev (devfs, local)
/dev/raid5/BigDiskp1 on /mnt/big_share (ufs, local, soft-updates, acls)
/dev/ad0s1 on /cf (ufs, local, read-only)
> ls -alh
total 20501
drwxrwxrwx 3 root wheel 512B Mar 27 23:36 .
drwxrwxrwx 3 root wheel 512B Mar 27 23:33 ..
drwxrwxr-x 2 root operator 512B Mar 26 23:54 .snap
-rw------- 1 root wheel 20M Mar 27 23:36 swap_file
> rm swap_file
override rw------- root/wheel for swap_file? y
> ls -alh
total 5
drwxrwxrwx 3 root wheel 512B Mar 27 23:55 .
drwxrwxrwx 3 root wheel 512B Mar 27 23:33 ..
drwxrwxr-x 2 root operator 512B Mar 26 23:54 .snap

Yes.... a simple user can delete a '600' file !
Then I try with system file:

> ls -alh /var/etc/master.passwd
-rw------- 1 root wheel 899B Mar 27 23:36 /var/etc/master.passwd
> rm /var/etc/master.passwd
override rw------- root/wheel for /var/etc/master.passwd? y
rm: /var/etc/master.passwd: Permission denied



Now I must found the difference between this two files...
Why can I delete the swap_file ??

lundi 26 mars 2007

0.684b is very close

I’ve found the problem with openssh-portable : It seem that openssh-portable haven’t the same default value as the FreeBSD sshd implementation. It needs the line “PasswordAuthentication yes” on the sshd_config file.
And I’ve added some messages about umouting drive that are used by swap file or iSCSI target and other little fix and prevent to format “used in a software raid drive” disk.
Now the code seem ready for 0.684b ;-)

User documentation is updated about the last features added: Only one choice for UFS (screen shot updates), and permit to use an USB key for storing configuration when using FreeNAS CDROM.

I’ve tried the just created FreeNAS-amd64 release CDROM, but my QEMU crash when I boot the CDROM… there should be a bug somewhere on the make.sh with the amd64 release :-(

Successful booting my software modified XBOX with the FreeBSD release (xbox-6stable-20060821.iso) .But I’ve just seen that the XBOX have only 64MB of RAM… And FreenNAS need a minium of 96MB :-(

For solving this 64MB problem I think that I should add a new install process for hard drive: It should no more use the method as flash device (using a RAM drive), but being installed directly on the hard drive (this will permit to simplify user modification of FreeNAS too). But this task is complex and will not be planned for the 0.684b. pfSense seem to use this method: I should check their code. This install method will permit to create a real SWAP partition too (permit to solve the ‘not enough RAM’ for fsck problem).

I’ve meet a problem since I’ve replace mini_httpd with lighttpd (there is a long time) : On the exec.php page the output of some commands (help option or error message) are no more display, but are send to the error.log of lighttpd… Perhaps this problem is solved on the pfSense project.

samedi 24 mars 2007

Add recovery tools and improve performance under VM

Yesterday I did a big mistake: I’ve upgrade my NAS server with a non-tested release of FreeNAS. And this release had a big bug that prevent me to start it again :-(

The process for recovery my system is quite simple:
1. Boot from a working FreeNAS CDROM
2. Mount the partition where is installed the bugged FreeNAS
3. Copy the config.xml from this partition to a tmp directory (in the RAM drive)
4. Unmount the partition
5. Re-install a working release of FreeNAS on this partition
6. Re-mount the partition where is now the working release
7. Copy the backuped config.xml from the RAM drive to this partition
8. reboot the computer

I choose to automated this process and add this tool as option on the install menu of FreeNAS (the install menu is now displayed only when booting from CDROM).

I found an interressant post on the forum that link to this cool blog:
http://ivoras.sharanet.org/freebsd/vmware.html
This article explains how to increase the performance of FreeBSD under a VM machine by replacing the network drivers and changing one kernel parameter.
Changing a network driver is not users transparent (because they must re-configure their LAN interfaces)… But I should not forget to add this mention in the 0.684b release notes:
If your FreeNAS is using a “lnc” interface, plug a keyboard/screen on your PC before to start the upgrade because you will have to reconfigure your LAN interface for using the new “le” driver!

I've installed FreeBSD on my laptop too (removed ubuntu)... This will permit to play with my aironet card and WPA one day.

I've still not added the code for protecting to format a disk used in a RAID volume :-(
I think to hide them for the format option, but it's more complex that I thought.

Using USB stick to save configuration.

I have added a new feature to use a USB stick to save the configuration when booting FreeNAS from CD. Alternatively a floppy disk can be used also.

vendredi 23 mars 2007

Playing with /dev/speaker

I've started to compile FreeNSD on FreeBSD AMD64 (my QEMU is still compiling the software used on FreeNAS).
And I found, for the moment, two problems:

===> aaccli depends on executable: aaccli - not found
===> aaccli-1.0 you need the 32-bit libraries installed under /usr/lib32 to use this port..
===> beep depends on executable: beep - not found
===> beep-1.0 is only for i386, and you are running amd64..

And, in my quest for a solution to solve the FreeBSD port of"beep", I found that this tools can be removed without problem ;-)

Here is example of using /dev/speaker device (you need to do a "kldload speaker.ko" before):
echo geL2eL4fdL2dL4cdefggg > /dev/speaker

echo
"l12<eaebegae>c<e>d<eb>c<eaebegae>c<e>d<eb>c<ebe"
> /dev/speaker
echo "T250L8CE-GE-C" > /dev/speaker


Then I can remove the 'beep' tools now, but I must found the equivalence to this old command:
beep -p 500 75
beep -p 1000 75
beep -p 2000 75
beep -p 3000 75

My actual equivalence is:
echo "O1L15aO2L15bO3L15cO4L15d" > /dev/speaker

Is someone can propose a better equivalence ?

Games open ;-)

jeudi 22 mars 2007

Limiting UFS File system creation choice

My 4 hours of train today, permit me to work on FreeNAS:
  • Replaced the 4 UFS choices for formatting an hard drive, by only one (EFI GPT with soft updates) and add the possibility to choose the minimum free space reserved (between 8% and 1%).
  • Rename the Software RAID name on the WebGUI by replace “geom. Mirror” by “RAID 1”, “geom. Concat” by “JBOD”, etc…
  • Continued to work on the FreeNAS presentation for the BSDCan2007
I’ve received a new language file: Russian, and a patch that permit to mount an ISO file directly from FreeNAS (But I think that I will add this feature after the 0.684b).

Next feature that I will works on:
Prevent the user to format an hard drive that is using in a software RAID volume.

And good news for blog reader…. As soon as the openssh-portable port will be fixed, I will release the 0.684b :-)

I will try to prepare and AMD64 release too (but using QEMU64 under a 32bit PC is very slow).

mercredi 21 mars 2007

Guide for Installing FreeBSD with QEMU under Windows XP

We've decide to use only the FreeBSD 6.2-release, and not the lastest FreeBSD code for FreeNAS.
Then I re-install a new FreeBSD under my Windows XP laptop and write a little guide with some screen shots for "HOW TO Install FreeBSD with QEMU under Windows XP for compiling FreeNAS".
I will try to keept this guide updated.

Disable openssh-portable

I've disabled the openssh-portable package again because of ssh login failures.
The original sshd shipped with FreeBSD6.2 is used instead, but this one has no HPN patch.

LDAP will not be working for the 0.684b

Here is the actual state of the day about my works.

RSYNC bug fixed : I forgot to add the hidden ‘id’ value (corresponding to the entry number) in the web form.

FAT32 and EXT2 formatting: I’ve remove the BSD label creation for these filesystem (it was an old bug created when I didn’t understand what was BSD label).

New problem founded with the Openssh-portable port: I meet the same problem as Volker. I can’t use SSH anymore: after entering my username I’m disconnected. I'm using the latest CVS code...

I found new features to be added:
- FreeNAS don’t use the background filesystem check for UFS. This is important to be added I think (because FreeNAS us Softupdate).
- I need to simplify the hard drive formatting page by proposing only one UFS type (I should impose using gpt) and let the user to choose only it’s ‘minimum free space threshold’ between 8% and 0%.

It seem that LDAP feature will no be working in the 0.684b release. I don't have time for setting up a OpenLDAP server on my FreeBSD.
And I must release this version soon: This will permit me to work on my paper about FreeNAS for the BSDCan2007.

mardi 20 mars 2007

Install problem fixed

My previous problem encounter when using the latest FreeBSD 6.2 code was fixed:
Replaced the defective FreeBSD 6.2 gzip binary by the gzip port.
Now I can install and upgrade my FreeNAS again.
I hope that the FreeBSD team will fix this problem on gzip (imported from NetBSD).

This week, If I got enough time, I will try to:
- Testing the possibility of creating ext2 filesystem that Volker just added.
- Fix the exisiting bug (that Dan discovered on the working 0.684b about RSYNC)
- Try to install an OpenLDAP server for testing the actual LDAP authentication feature that I've added but not tested.

dimanche 18 mars 2007

Can't no more install FreeNAS

(First post!)

Since the last week, I can't install FreeNAS on my virtual machine (same problem under KQEMU and VMware).
When booting from the CDROM (or upgrading from WebGUI) I meet this error message (try to install it in both mode):

gunzip: error writing to output: Broken pipe
gunzip: img file: uncompress failed


Then, from the shell I've try to install it manually:

# mkdir /mnt/cdrom_fr_0507
# mount -t cd9660 /dev/acd0 /mnt/cdrom_fr_0507
# /usr/bin/gunzip -S "" -c /mnt/cdrom_fr_0507/FreeNAS-generic-pc.gz | dd of=/dev/ad0 bs=512
dd: /dev/ad0: Invalid argument
1278+1 records in
1278+0 records out
654336 bytes transferred in 0.917600 secs (713095 bytes/sec)


It seem ok but I don't remember if the message "dd: /dev/ad0: Invalid argument" is a normal message.

Then I check the fresh hard drive:

# mkdir /mnt/tutu
# mount /dev/ad0a /mnt/tutu
# ls -alh /mnt/tutu/
ls: boot: Bad file descriptor
ls: conf: Bad file descriptor
total 15291
drwxr-xr-x 5 root wheel 512B Mar 18 16:11 .
drwxrwxrwx 4 root wheel 512B Mar 19 00:03 ..
drwxrwxr-x 2 root operator 512B Mar 18 16:11 .snap
-rw-r--r-- 1 root wheel 15M Mar 18 16:11 mfsroot.gz


It seem that the IMG file is not correctly 'dd' on the hard drive (Bad file descriptor for the boot directory).

Then I checked the IMG file on the CDROM (using another drive ad1 for testing it):
# fdisk -I /dev/ad1
******* Working on device /dev/ad1 *******
fdisk: invalid fdisk partition table found
fdisk: Geom not found
# newfs /dev/ad1s1
/dev/ad1s1: 99.9MB (204560 sectors) block size 16384, fragment size 2048
using 4 cylinder groups of 24.98MB, 1599 blks, 3200 inodes.
super-block backups (for fsck -b #) at:
160, 51328, 102496, 153664

# mkdir /mnt/testing
# mount /dev/ad1s1 /mnt/testing/
# cp /mnt/cdrom_fr_0507/FreeNAS-generic-pc.gz /mnt/testing/
# cd /mnt/testing/
# gunzip FreeNAS-generic-pc.gz
# mdconfig -a -t vnode -f FreeNAS-generic-pc -u 1
# mkdir /mnt/check
# mount /dev/md1a /mnt/check/
# ls -alh /mnt/check/
total 15293
drwxr-xr-x 5 root wheel 512B Mar 18 16:11 .
drwxrwxrwx 6 root wheel 512B Mar 19 00:07 ..
drwxrwxr-x 2 root operator 512B Mar 18 16:11 .snap
drwxr-xr-x 4 root wheel 512B Mar 18 16:11 boot
drwxr-xr-x 2 root wheel 512B Mar 18 16:11 conf
-rw-r--r-- 1 root wheel 15M Mar 18 16:11 mfsroot.gz

No problem on this IMG file.. the problem seem coming from the "dd" command...