Operating System - HP-UX
1834462 Members
3520 Online
110067 Solutions
New Discussion

Re: unable to mount a CDROM correctly

 
SOLVED
Go to solution
John Carr_2
Honored Contributor

unable to mount a CDROM correctly

The background: I created a backup of some important data a while back on my laptop using a HP CD writer. Unknown at the time I had a virus on the laptop which changed the permissions of all the files to read only.

I am able to see all the files but not open them when using a PC.

When I mount the CD on my HPUX B132 workstation using pfs_mount I can see all the files but the filenames all have ;1 afterthem indicating I believe the drive is not correctly mounted.

In my pfs_fstab file I have tried hsfs iso9660 and hsfs all with the same result.

Are there any commands to interogate the CD format?

cheers guys.
4 REPLIES 4
H.Merijn Brand (procura
Honored Contributor

Re: unable to mount a CDROM correctly

Here's a script to always mount the CD the way it should (CDFS vs. ISO-9660 with RR extensions)

modify line 5 with your device and mount point. Have fun.

#!/usr/bin/perl -w

use strict;

my ($cmd, $dev, $mnt) = ("mount", "/dev/cd0", "/cdrom");

sub usage ()
{
print STDERR "Usage: $0 [ ]\n",
" mount CD-ROM on $mnt for ISO-9660 with RockRidge extens
ions\n";
exit;
} # usage

@ARGV == 1 and $ARGV[0] eq "-?" || $ARGV[0] =~ m/^-+help$/ and usage;

sub stop (@)
{
print STDERR @_;
exit 1;
} # stop

@ARGV and $mnt = shift;

$< == 0 or stop "You have to be root to be able to mount\n";
$mnt =~ m:^/: or stop "Mountpoint should be an absolute pathname\n";
-d $mnt or stop "Mountpoint $mnt is not available\n";

if ($^O eq "hpux") {
my $fst = "/etc/pfs_fstab";
$cmd = "pfs_mount";
unless (-s $fst) {
-b $dev or stop "Cannot mount $mnt on $dev, device does not exist\n";
open my $fs, "> /etc/pfs_fstab" or stop "Cannot create $fst: $!";
print $fs "$dev $mnt pfs-rrip xlat=unix 0 0\n";
close $fs;
}
unless (grep m/\bpfsd$/, `ps -e`) {
print STDERR "Starting PFS\n";
system "nohup /usr/sbin/pfs_mountd &";
system "nohup /usr/sbin/pfsd &";
sleep 1;
}
unless (grep m/\bpfsd$/, `ps -e`) {
print STDERR "PFS not running\n";
exit $!;
}
}

$0 =~ m/umount/ and $cmd =~ s/mount/umount/;

if (grep m/^pfs_u?mount:/, qx "$cmd $mnt") {
$cmd =~ s/^pfs_//;
system "$cmd $mnt";
}
Enjoy, Have FUN! H.Merijn
eran maor
Honored Contributor
Solution

Re: unable to mount a CDROM correctly

Hi John

this is easy .
you need to use this command :

mount -o cdcase /dev/dsk/cXtXdX /cdrom

use all ways the -o cdcase to mount a cd that is a pc cd ( juliet format )

love computers
John Carr_2
Honored Contributor

Re: unable to mount a CDROM correctly

Hi guys

well the mount option worked fine but I still have a problem I am unable to copy some of the files from the CD. when I usr the cp command
I receive this message cp: bad copy to /tmp/filename.jpg: read I/O error.

when I try to do the copy with the CD in a windows 2000 server it simply says the file is read only and no error message.
eran maor
Honored Contributor

Re: unable to mount a CDROM correctly

Hi John

this is very strage , mybe the write to the cd was not good .

i will advise you :
1. scan the disk for virus .
( i saw a few cases that there were virus on cd's for unix )

2. try to do a copy disk frew the cd-software that you have and mount it again .

read io error means that the cd is not good .

mybe you can copy all the files to a win-2000 folder and then burn it again .

hope that you can restore the files !!
love computers