Quick Review: Boxee Box
December 27, 2011 – 12:22 am | 3 Comments

Some of the technical issues with Boxee Box could have been fixed if the dev team was paying more attention to addressing the bugs rather than adding “features” of dubious value. In the final analysis, for the price and ease of use, Boxee Box is the best in its class and price range. You just need to be mindful of its limitations and buy it in hope of future improvements to its usability.

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Backups, Commands & Shells

Working with ISO images on Solaris

Submitted by on November 22, 2005 – 4:57 pmNo Comment
Working with ISO images on Solaris

The following two commands will take all data in /home/neal, copy it to the ISO file, and burn the ISO file to a recordable CD.

mkisofs -l -L -r -o /local/mycdromfile2.iso  /home/neal
cdrecord -v /local/mycdromfile2.iso

The resulting ISO image can be mounted directly from hard drive, without having to burn it to a CD. Here’s how:

mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mountpoint

The following script allows you to rip a CD-ROM to your hard drive as an ISO file and mount the file as a virtual CD.

#!/bin/sh
# igor@krazyworks.com
#
# Rip CD-ROM to ISO image, mount, and share
 
clear
 
if [ `uname -a | egrep -ic linux` -gt 0 ]
then
        OSTYPE="Linux"
elif [ `uname -a | egrep -ic "sunos|solaris"` -gt 0 ]
then
        OSTYPE="Solaris"
else
        echo ""
        echo "Unsupported OS: this script will only work under Solaris or Linux."
        exit
fi
 
echo "OS type: $OSTYPE"
echo ""
echo "This script will create an ISO image of the CD-ROM currently in the"
echo "local CD drive on `hostname`. This sceript must be executed as root."
echo "The copy process may take over 10 minutes depending on the speed of"
echo "the CD drive. During the copy process the script will temporarily"
echo "disable the automounter."
echo ""
 
if [ "$OSTYPE" = "Solaris" ]
then
        echo "Proceed with the copy process? [y/n]: \c"
elif [ "$OSTYPE" = "Linux" ]
then
        echo -n "Proceed with the copy process? [y/n]: "
fi
read RESPONSE1
if [ "$RESPONSE1" != "y" ]
then
        exit
fi
 
#--------------------------------------------
# CREATE ISO IMAGE
#--------------------------------------------
 
echo ""
if [ "$OSTYPE" = "Solaris" ]
then
        echo "Enter the location for storing ISO images: \c"
elif [ "$OSTYPE" = "Linux" ]
then
        echo -n "Enter the location for storing ISO images: "
fi
read ISODIR
if [ ! -d "$ISODIR" ]
then
        echo "Directory not found: $ISODIR"
        exit
fi
 
echo ""
if [ "$OSTYPE" = "Solaris" ]
then
        echo "Enter CD-ROM title: \c"
elif [ "$OSTYPE" = "Linux" ]
then
        echo -n "Enter CD-ROM title: "
fi
read ISONAME
 
ISONAME=`echo "$ISONAME" | sed 's/ /_/g'`
 
if [ -f "$ISODIR/$ISONAME.iso" ]
then
        echo ""
        if [ "$OSTYPE" = "Solaris" ]
        then
        echo "Image $ISODIR/$ISONAME.iso already exists. Do you want to delete it? [y/n]: \c"
        elif [ "$OSTYPE" = "Linux" ]
        then
                echo -n "Image $ISODIR/$ISONAME.iso already exists. Do you want to delete it? [y/n]: "
        fi
        read RESPONSE4
        if [ "$RESPONSE4" = "y" ]
        then
                if [ `df | fgrep -c "$ISODIR/$ISONAME"` -gt 0 ]
                then
                        unshare $ISODIR/$ISONAME > /dev/null
                        umount $ISODIR/$ISONAME > /dev/null
                        rm $ISODIR/$ISONAME.iso
                fi
        else
                exit
        fi
fi
 
if [ "$OSTYPE" = "Solaris" ]
then
        echo ""
        echo "Ejecting CD-ROM..."
                eject cdrom
        echo "Stopping volume management..."
                /etc/init.d/volmgt stop
        echo ""
        echo "Insert CD-ROM you wish to copy and press enter when ready...\c"
        read RESPONSE3
        echo "Detecting CD..."
        sleep 10
elif [ "$OSTYPE" = "Linux" ]
then
        echo ""
        echo -n "Insert CD-ROM you wish to copy and press enter when ready..."
        read RESPONSE3
        sleep 5
fi
 
echo ""
echo "Creating ISO image. This process may take several minutes."
echo ""
 
if [ "$OSTYPE" = "Solaris" ]
then
        dd if=/dev/rdsk/c0t6d0s2 of="$ISODIR/$ISONAME.iso" bs=1024k
elif [ "$OSTYPE" = "Linux" ]
then
        dd if=/dev/cdrom of="$ISODIR/$ISONAME.iso" bs=1024
fi
 
if [ $? -eq 0 ]
then
        echo ""
        echo "ISO image created: "
        ls -als "$ISODIR/$ISONAME.iso"
else
        echo ""
        echo "ISO could not be created."
 
        if [ "$OSTYPE" = "Solaris" ]
        then
                echo ""
                echo "Re-enabling volume management..."
                /etc/init.d/volmgt start
        fi
        exit
fi
 
#--------------------------------------------
# MOUNT & SHARE ISO IMAGE
#--------------------------------------------
 
echo ""
if [ "$OSTYPE" = "Solaris" ]
then
        echo "Do you wish to mount and export this ISO image? [y/n]: \c"
elif [ "$OSTYPE" = "Linux" ]
then
        echo -n "Do you wish to mount and export this ISO image? [y/n]: "
fi
        read RESPONSE5
if [ "$RESPONSE5" != "y" ]
then
        exit
fi
 
if [ ! -d "$ISODIR/$ISONAME" ]
then
        mkdir "$ISODIR/$ISONAME"
fi
 
if [ "$OSTYPE" = "Solaris" ]
then
        echo ""
        echo "Re-enabling volume management..."
                /etc/init.d/volmgt start
        sleep 5
        echo "Mounting $ISODIR/$ISONAME.iso $ISODIR/$ISONAME"
        mount -F hsfs -o ro `lofiadm -a $ISODIR/$ISONAME.iso` $ISODIR/$ISONAME
elif [ "$OSTYPE" = "Linux" ]
then
        echo ""
        echo "Mounting $ISODIR/$ISONAME.iso $ISODIR/$ISONAME"
        mount "$ISODIR/$ISONAME.iso" "$ISODIR/$ISONAME" -t iso9660 -o ro,unhide,loop=/dev/loop0 > /dev/null
fi
 
if [ $? -eq 0 ]
then
        share -F nfs -o ro,anon=0 $ISODIR/$ISONAME > /dev/null
        echo ""
        echo "$ISONAME.iso is mounted under $ISODIR/$ISONAME and shared globally in read-only mode."
        echo ""
        echo "You can mount this image as virtual CD-ROM from a remote system by running:"
        echo "mount -o -ro `hostname`:$ISODIR/$ISONAME /local_mountpoint"
        echo ""
else
        echo ""
        echo "$ISONAME.iso could not be mounted."
        exit
fi
exit

Popularity: 2% [?]

Related posts:

  1. Create and mount ISO image under Solaris
  2. Solaris boot disk copy
  3. Resetting Root Password under Solaris
  4. Using rsync to copy files
  5. Apache MySQL PHP Solaris 8 Installation
  6. Check if Solaris supports 64-bit applications
  7. Install PHP, Mysql, Apache2 on Solaris 9
  8. Find largest files

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.