Thursday Apr 19, 2007

Fc Target Machine Hardware Requirement 
1. FC-HBA: QLA2200 (1G) or QLA2300(2G); 
 
Fc Target Machine Hardware Requirement 
1. Redhat Linux 9 
2. kernel 2.6.10 (http://www.kernel.org) 
3. scst-0.9.2 (http://scst.sourceforge.net) 
4. qla2x00-0.9.3.2 (http://scst.sourceforge.net) 
 
Compilation: 
1. Update your kernel to 2.6.10, with kernel source in 
/usr/src/linux-2.6.10 
2. ln -s /usr/src/linux-2.6.10 /lib/modules/2.6.10/build 
3. cd your work dir in /root with all the tars in it 
4. tar xvzf scst-0.9.2.tar.gz 
5. cd scst-0.9.2 
6. modify init_scst function in scst.c: cpu_online_num can't be 
resolved for NON_SMP machine; 
7. make install 
8. cd .. 
9. tar xvzf qla2x00-target-0.9.3.2 
10. cd qla* 
11. Modify Makefile, point to the right scst-0.9.2 directory 
12. make install 
 
Test: 
dd if=/dev/zero of=/vdisks/scsi_disk_file_0 count=1 
1. modprobe qla2300tgt (qla2200tgt) 
2. modprobe scst_disk_fileio dir=/vdisks count=1 
3. connect FC cables between Solaris initator and Linux Target machine. 
4. rescsn and you will find the new fc disk, and do dd or tar to test. 

(mainly from  manpage of lofiadm)
Example 1: Mounting an Existing CD-ROM Image 

You should ensure that Solaris understands the image before creating the CD. lofi allows you to mount the image and see if it works. 
This example mounts an existing CD-ROM image (sparc.iso), of the Red Hat 6.0 CD which was downloaded from the Internet. It was created with the mkisofs utility from the Internet. 
 
Use lofiadm to attach a block device to it: 
# lofiadm -a /home/mike_s/RH6.0/sparc.iso 
/dev/lofi/1 
 
lofiadm picks the device and prints the device name to the standard output. You can run lofiadm again by issuing the following command:
# lofiadm 
Block Device File 
/dev/lofi/1 /home/mike_s/RH6.0/sparc.iso 
 
Or, you can give it one name and ask for the other, by issuing the following command: 
# lofiadm /dev/lofi/1 
/home/mike_s/RH6.0/sparc.iso 
 
Use the mount command to mount the image: 
# mount -F hsfs -o ro /dev/lofi/1 /mnt 
 
Check to ensure that Solaris understands the image: 
# df -k /mnt 
Filesystem kbytes used avail capacity Mounted on 
/dev/lofi/1 512418 512418 0 100% /mnt 
# ls /mnt 

Solaris can mount the CD-ROM image, and understand the filenames. The image was created properly, and you can now create the CD-ROM with confidence.
As a final step, unmount and detach the images:
# umount /mnt 
# lofiadm -d /dev/lofi/1 
# lofiadm 
Block Device File 
...

Example 3: Making a UFS Filesystem on a File 
 
Making a UFS filesystm on a file can be useful, particularly if a test suite requires a scratch filesystem. It can be painful (or annoying) to have to re-partition a disk just for the test suite, but you don't have to. You can newfs a file with lofi 

Create the file: 
# mkfile 35m /export/home/test 

Attach it to a block device. You also get the character device that newfs requires, so newfs that:
# lofiadm -a /export/home/test 
/dev/lofi/1 
# newfs /dev/rlofi/1 
newfs: construct a new file system /dev/rlofi/1: (y/n)? y 
/dev/rlofi/1: 71638 sectors in 119 cylinders of 1 tracks, 602 sectors 
35.0MB in 8 cyl groups (16 c/g, 4.70MB/g, 2240 i/g) 
super-block backups (for fsck -F ufs -o b=#) at: 
32, 9664, 19296, 28928, 38560, 48192, 57824, 67456, 

Note that ufs might not be able to use the entire file. Mount and use the filesystem:  
# mount /dev/lofi/1 /mnt 
# df -k /mnt 
Filesystem kbytes used avail capacity Mounted on 
/dev/lofi/1 33455 9 30101 1% /mnt 
# ls /mnt 
./ ../ lost+found/ 
# umount /mnt 
# lofiadm -d /dev/lofi/1

Wednesday Apr 18, 2007

1. # cdrecord -scanbus  (to get the CD/DVD writer device name)
2.
# cdrecord -dev=0,0,0 /net/kungfu/export/home1/simon/supplement.iso (to burn)
3.
# mkisofs -J -r -L -V My_Test_Image -o /var/tmp/myimage.iso /some/directory (to create an image from the directory)

More information (mainly from manpage of cdrecord):
If the overall speed of the system is sufficient and the structure of the filesystem is not too complex, cdrecord will run without creating an image of the ISO 9660 filesystem. Simply run the pipeline:

# mkisofs -R /master/tree | cdrecord -v fs=6m speed=2 dev=2,0 -

To create an image for a ISO 9660 filesystem with Rock Ridge extensions:
# mkisofs -R -o cdimage.raw /home/joerg/master/tree

To check the resulting file before writing to CD on Solaris:
# mount -r -F fbk -o type=hsfs /dev/fbk0:cdimage.raw /mnt

This blog copyright 2009 by reed