New feature!
September 7th, 2010Have you noticed? There a “Tweet” button to allow you tweet the posts you like and find useful!
Help yourself!
Getting text encoding issues in a Web page
June 4th, 2008If you are writing an internationalized web application, you may encounter some issues with accents.
Indeed, the character
é
can become the following
é
.
This is due to the encoding of your files.
To check the encoding of a file, run:
user@server:~/w3# file -i accueil.php accueil.php: text/x-c charset=iso-8859-1
According to the charsets you will use and the configuration of the server on which your app will run, you might want to choose a different encoding. I’ve chosen to encode my file in UTF-8.
user@server:~/w3# iconv -f iso-8859-1 -t utf-8 accueil.php > accueil.php.1
Then, you have to make sure that the web browser will use the correct encoding. To do so, the following meta markup will be used in the web pages:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
Get access to the OBP prompt on a Sun T5120 / T5220
May 21st, 2008[UPDATE] This is also true on Sun blade servers T6320!
Just getting a T5220 out of the box, the auto-boot? parameter is set to true.
This means that one does not have access to the ok prompt when powering up the server the first time.
Due to the new release of iLOM, the break command does not end on the ok prompt.
According to Sun documentation one can send a graceful shutdown (init 0) to get to the ok prompt. The following menu is then displayed:
r)eboot, o)k prompt, h)alt?
The problem is that one must have to proceed with the first installation.
To workaround this, one may set the auto-boot? value to false and reset the system. From the ilom, set the value to false, and reboot the server:
-> set /HOST/bootmode script="setenv auto-boot? false" Set 'script' to 'setenv auto-boot? false' -> set /HOST send_break_action=break Set 'send_break_action' to 'break' -> start /SP/console Are you sure you want to start /SP/console (y/n)? y Serial console started. To stop, type #. c)ontinue, s)ync, r)eboot, h)alt? r Resetting... SPARC Enterprise T5220, No Keyboard Copyright 2007 Sun Microsystems, Inc. All rights reserved. OpenBoot 4.27.1, 3968 MB memory available, Serial #80993514. Ethernet address 0:14:4f:d3:dc:ea, Host ID: 84d3dcea. auto-boot? = false
One can now boot the server on LAN ![]()
{0} ok boot net - install Ubuntu 8.04 Hoary USB stick persistent - Unclean casper-rw unmount
May 4th, 2008You may have been confronted to this issue: when using Ubuntu Hoary on a USB stick in persistent mode, the casper-rw partition is not cleanly unmounted.
If this happens, the default user home folder may be corrupted. Then the profile can not be loaded.
To fix this, I’ve modified the initrd.gz, by adding the e2fsck tool to it and forcing the checking of the casper-rw partition before mounting it.
0/ Some pre-requisites
The following is based on the Ubuntu wiki.
The squashfs filesystem will be modified. To do so the squashfs-tools package is to be installed on your machine.
Extract the casper/filesystem.squashfs file from the Ubuntu Hoary iso to /mnt/hoary:
root@server:~# mkdir -p /mnt/hoary root@server:~# cd /mnt/hoary root@server:/mnt/hoary# unsquashfs /media/cdrom/casper/filesystem.squashfs
1/ Adding the e2fsck tool to the initrd
Edit the following file
/mnt/hoary/squashfs-root/usr/share/initramfs-tools/hooks/casper
and add these lines
# We need fsck to check the persistent casper-rw partition copy_exec /sbin/e2fsck /sbin
Here is the patch to apply to hooks/casper.
2/ Forcing the checking of the casper-rw partition
Edit this file:
/mnt/hoary/squashfs-root/usr/share/initramfs-tools/scripts/casper
and add the following lines
log_warning_msg "Checking the casper-rw partition ${cowdevice}"
e2fsck -v -y ${cowdevice} || \\
log_warning_msg "Not able to check the ${cowdevice} partition"
log_warning_msg "Mounting the casper-rw partition"
before the
mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \\
panic "Can not mount $cowdevice on /cow"line. (See also this post)
Here is the patch to apply to the casper file.
3/ Build of the initrd.gz
chroot to the extracted squashfs filesystem. Use mkinitramfs to build the modified initrd.gz.
root@server:/mnt/hoary/squashfs-root# chroot . root@server:/# mkinitramfs -o initrd.gz 2.6.24-16-generic
4/ Copy the initrd.gz to the USB stick
root@server:/# exit root@server:/mnt/hoary/squashfs-root# cp initrd.gz /media/ubuntu
5/ Build the squashfs file
root@server:/mnt/hoary/squashfs-root# mksquashfs . ../filesystem.squashfs root@server:/mnt/hoary/squashfs-root# cp ../filesystem.squashfs \\ /media/ubuntu/casper
Your USB persistent live system is now fully operational! Enjoy!
Ubuntu 8.04 Hoary persistent on a USB stick
May 4th, 2008When tring to boot Ubuntu 8.04 with the persistent option on a USB stick, an error occurs, leading to the prompt:
(initramfs)
From this prompt, a casper.log log file is available. The following error is logged:
(initramfs) cat casper.log [...] mount: Mounting /dev/sda2 on /cow failed: Invalid argument
From this prompt, I’ve run the mount command that is used in the casper script:
(initramfs) mount /dev/sda2 -o rw,noatime,mode=755 /cow mount: Mounting /dev/sda2 on /cow failed: Invalid argument
It looks like the mode option is “deprecated", or at least is failing here:
(initramfs) mount /dev/sda2 -o rw,noatime /cow [ 83.282753] EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
Therefore, the squashfs-root/usr/share/initramfs-tools/scripts/casper script needs to be modified:
mount ${cowdevice} -t ${cow_fstype} -o rw,noatime,mode=755 /cow || \
panic "Can not mount $cowdevice on /cow"is to be replaced by
mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \
panic "Can not mount $cowdevice on /cow" Building a bootable DVD to deploy a Solaris Flash Archive
April 28th, 2008Almost every thing to build a bootable DVD to deploy a Solaris Flash Archive is documented in the Sun Blueprints document 817-6991.pdf.
This document is for Solaris 9, but can easily be used to build a Solaris 10 DVD.
The aim of this post is to give a little tip if you want to deploy a mirrored configuration.
As the default “vanilla” Solaris 10 DVD distribution is not handling mirrored installation, you may face the following error:
Creating SVM Meta Devices. Please wait ...
- Creating SVM State Replica on disk c0t1d0s7
- metadb: sunserver: /dev/dump: No such file or directory
- Creating SVM Mirror Volume d0 (/)
- Creating SVM Mirror Volume d1 (swap)
- Creating SVM Mirror Volume d3 (/var)
- Creating SVM Mirror Volume d4 (/usr)
- Creating SVM Mirror Volume d5 (/opt)
- Creating SVM Mirror Volume d6 (/home)
ERROR: Could not mount / (/dev/md/dsk/d0)
ERROR: Could not mount the configured file system(s)
ERROR: Flash installation failed
Solaris installation program exited.
The error:
metadb: sunserver: /dev/dump: No such file or directory
can be fixed by running devfsadm in a script during the pre-installation phase.
I’m using a begin-script (declared in rules file) in which the following lines have been added:
# Running devfsadm to initialize the devices # This is required as we are installing from a DVD with a mirrored configuration # devfsadm -v
Hope this helps ![]()
