Friday, August 29, 2008

Mounting ISO and DD Image Files

Occasionally, I'll download an image file and want to see what is on it, or make a few changes to it before burning it to CD.

The image file (dd, iso, etc) can be mounted using the loop device. You will need to know the type of filesystem the image uses.

Most Linux/Unix-based OS's have an application that will help you identify the filesystem type. Debian includes the command /lib/udev/vol_id, SUSE has the same command but in a different location (/sbin/vol_id). If you know how to get this information on a SUN box, please leave a comment for us.

If you don't have a command that will tell you the filesystem type, you can guess. Most images downloaded from the Internet will be iso9660, Windows filesystems are normally ntfs, Linux are commonly ext2, and Macintosh are udf or hfs.

As a last resort, you can work your way down the list of filesystem types listed in the mount man pages.

After you know the filesystem type, you are ready to mount.
Note: replace <_type> with the filesystem type.

To mount the file livebootcd.iso with write enabled:

mount -t <_type> -o loop ./livebootcd.iso /mnt

To mount an image made from a Windows partition in read-only mode:

mount -t ntfs -o loop,ro,umask=0222 ./evidence.dd /mnt

Post provided by Mary M. Chaddock

Tuesday, August 19, 2008

Hardware Mismatch for Fibre Channel Hard Drive

We had a hard drive (FC) mismatch and had to rebuild the path_to_inst file and /dev/rdsk/*, /dev/dsk/* and /dev/rmt/* directories. We had two drives (but the backup drive was inoperable), so instead of booting off the backup, we had to recover via cdrom. That part was a little trickier than expected. After a little web searching, a handy disaster discovery procedure (hardware mismatch) was found on the Sun BigAdmin site.

Method 1 (towards the bottom of the Sun page)

Here is what was done.

Boot from CDROM
ok boot cdrom -s
# mount /dev/dsk/c1t#d#s0 /mnt
Rename path_to_inst
# mv /mnt/etc/path_to_inst /mnt/etc/path_to_inst.org
Remove all old device links
# rm /mnt/dev/rdsk/c1*; rm /mnt/dev/dsk/c1*; rm /mnt/dev/rmt/*
Rebuild path_to_inst and devices (this (syntax) was the part we were missing)
# devfsadm -r /mnt -p /mnt/etc/path_to_inst
**Note: Suspect corrupted bootblock? - reinstall it.
# cd /mnt/usr/platform/`uname -i`/lib/fs/ufs
# /mnt/usr/sbin/installboot bootblk /dev/rdsk/c1t#d#s0
Unmount root slice and reboot
# cd /
# umount /mnt; init 6

By the way, we tried method two (boot -rav) prior to performing the web search but each attempt failed.

Unable to Switch User Error - su: no shell

We had some users complaining about not being able to switch or substitute user, su. Here is the error message they were receiving: "su: no shell.” At first I thought the users had inadvertently locked out their accounts. But after querying nisplus and checking the file-based users, I didn’t observe any locked accounts. I tried switching to various users from root and received the same error. Then I tried switching user on a different workstation - no problem. The problem was tied to a particular box.

Then we used the truss command to trace the system/lib calls. It pointed to an unexpected access/permission issue. Observed the /usr directory was set to 600. Frankly speaking, the permission problem was somewhat a surprise since it was working fine the previous day. At any rate, changed the permissions and things were back to normal.

# truss su esofthub

Sunday, August 03, 2008

iPod Disconnected During Recharge

I know this topic is not Unix or sysadmin related, but I thought I'd document it for reference. This morning one of our personal home computers was inadvertently powered off while an iPod was recharging. To me, it didn't seem like a big deal. The PC was powered back up and the iPod was "reconnected" and it should be “okay.” But after six hours or so, I was frantically informed the iPod screen was still frozen – the "Do not disconnect" message and its related symbol were still displayed.

I started wondering if I was going to have to shell out another 400 bucks, especially since I was the inadvertent power off culprit. I asked for the manual but it was MIA--no surprise there. It was time for a quick Web search.

I found this little jewel on the Apple support site: “Try resetting your iPod to solve common problems by pressing and holding the Menu and Select buttons until the Apple logo appears, about 6 to 10 seconds. You may need to repeat this step.”

Whew, it worked the first time.