Home

split_cdrom_isoimage.sh




Purpose

split_cdrom_isoimage.sh can be used to split a Solaris installation CDROM or DVD into slices. These slices can than be mounted using lofiadm. This is useful, if you want to access other slices than slice 0 from a Solaris installation CDROM/DVD ISO images  without burning the ISO images. (lofiadm itself can only access the slice 0 with the HSFS filesystem of these CDROMs/DVDs).


Back to top

License


# CDDL HEADER START
#
# The contents of this file and the script are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END


Back to top

History


Version
Releasedate
         Description
1.00
2004



Back to top

Operating system

Solaris


Back to top

Language / type

Kornshell Script


Back to top

Prerequisites

n/a


Back to top

Usage


[07.02.2005 21:34:21] split_cdrom_isoimage.sh started on Mon Feb 7 21:34:21 MET 2005

  split_cdrom_isoimage.sh 1.00 - split an ISO image into slices

  Usage: split_cdrom_isoimage.sh [-v] [-q] [-h] [-l logfile] [-i isoimage] [-o outputdir]

  Parameter:

      -v - turn verbose mode on
      -q - turn quiet mode on
      -h - show usage
      -l - set the logfile

      -i - iso image file
      -o - directory for the output files (def.: current directory)
[07.02.2005 21:34:21] The log file used was "/var/tmp/split_cdrom_isoimage.sh.LOG.9352.TEMP"
[07.02.2005 21:34:21] split_cdrom_isoimage.sh ended on Mon Feb 7 21:34:21 MET 2005.
[07.02.2005 21:34:21] The RC is 1.
bash-2.05#



Back to top

Examples

# Split a cdrom with 6 used slices:

bash-2.05# split_cdrom_isoimage.sh -i /bootcd/img/sol8_9.iso -o .
[09.02.2005 22:59:51] split_cdrom_isoimage.sh started on Wed Feb 9 22:59:51 MET 2005
[09.02.2005 22:59:53] Using the log file "/var/tmp/split_cdrom_isoimage.sh.LOG"
split an ISO image into slices

Creating the vtoc file in "./sol8_9.iso.vtoc" ...
1+0 records in
1+0 records out
Creating slice 0 in "./sol8_9.iso.s0" ...
  Calculating the slice infos ...
  Writing the slice (StartCylinder is 0, Length is 0000001920) ...
1920+0 records in
1920+0 records out
Creating slice 1 in "./sol8_9.iso.s1" ...
  Calculating the slice infos ...
  Writing the slice (StartCylinder is 1920, Length is 0000679040) ...
679040+0 records in
679040+0 records out
Creating slice 2 in "./sol8_9.iso.s2" ...
  Calculating the slice infos ...
  Writing the slice (StartCylinder is 680960, Length is 0000184320) ...
184320+0 records in
184320+0 records out
Creating slice 3 in "./sol8_9.iso.s3" ...
  Calculating the slice infos ...
  Writing the slice (StartCylinder is 865280, Length is 0000086400) ...
86400+0 records in
86400+0 records out
Creating slice 4 in "./sol8_9.iso.s4" ...
  Calculating the slice infos ...
  Writing the slice (StartCylinder is 951680, Length is 0000032000) ...
32000+0 records in
32000+0 records out
Creating slice 5 in "./sol8_9.iso.s5" ...
  Calculating the slice infos ...
  Writing the slice (StartCylinder is 983680, Length is 0000002560) ...
2560+0 records in
2560+0 records out
Creating slice 6 in "./sol8_9.iso.s6" ...
  Calculating the slice infos ...
  Writing the slice (StartCylinder is 986240, Length is 0000086400) ...
86400+0 records in
86400+0 records out
Creating slice 7 in "./sol8_9.iso.s7" ...
  Calculating the slice infos ...
Slice not found. Skipping.
 ... all done.
[09.02.2005 23:05:20] The log file used was "/var/tmp/split_cdrom_isoimage.sh.LOG"
[09.02.2005 23:05:20] split_cdrom_isoimage.sh ended on Wed Feb 9 23:05:20 MET 2005.
[09.02.2005 23:05:20] The RC is 0.
bash-2.05#


Now mount the images:

bash-2.05# ls
sol8_9.iso.s0    sol8_9.iso.s1    sol8_9.iso.s2    sol8_9.iso.s3    sol8_9.iso.s4    sol8_9.iso.s5    sol8_9.iso.s6    sol8_9.iso.vtoc

bash-2.05# mkdir s0 s1 s2 s3 s4 s5 s6 

bash-2.05# lofiadm -a  /var/develop/test2/sol8_9.iso.s1
/dev/lofi/1

bash-2.05# lofiadm -a  /var/develop/test2/sol8_9.iso.s2
/dev/lofi/2

bash-2.05# lofiadm -a  /var/develop/test2/sol8_9.iso.s3
/dev/lofi/3

bash-2.05# lofiadm -a  /var/develop/test2/sol8_9.iso.s4
/dev/lofi/4

bash-2.05# lofiadm -a  /var/develop/test2/sol8_9.iso.s5
/dev/lofi/5

bash-2.05# lofiadm -a  /var/develop/test2/sol8_9.iso.s6
/dev/lofi/6

bash-2.05# lofiadm -a  /var/develop/test2/sol8_9.iso.s0
/dev/lofi/7

bash-2.05# mount -o ro -F hsfs /dev/lofi/7 /var/develop/test2/s0
bash-2.05# mount -o ro -F ufs /dev/lofi/1 /var/develop/test2/s1
bash-2.05# mount -o ro -F ufs /dev/lofi/2 /var/develop/test2/s2
bash-2.05# mount -o ro -F ufs /dev/lofi/3 /var/develop/test2/s3
bash-2.05# mount -o ro -F ufs /dev/lofi/4 /var/develop/test2/s4
bash-2.05# mount -o ro -F ufs /dev/lofi/5 /var/develop/test2/s5
bash-2.05# mount -o ro -F ufs /dev/lofi/6 /var/develop/test2/s6

bash-2.05# df -k | grep lofi
/dev/lofi/7           536352  536352       0   100%    /var/develop/test2/s0
/dev/lofi/1           319230  291020       0   100%    /var/develop/test2/s1
/dev/lofi/2            85194   77864       0   100%    /var/develop/test2/s2
/dev/lofi/3            39667   39512       0   100%    /var/develop/test2/s3
/dev/lofi/4            14007   13143       0   100%    /var/develop/test2/s4
/dev/lofi/5               30       4      24    15%    /var/develop/test2/s5
/dev/lofi/6            39667   33856    1845    95%    /var/develop/test2/s6
bash-2.05#


Back to top

Notes

You can use share_cdrom_images.sh to share the slice files created by split_cdrom_isoimage.sh



Back to top

Download


Download split_cdrom_isoimage.sh



Back to top