[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: stereo component from laptop?



On Thu, Dec 01, 2005 at 04:30:45PM -0500, Matt Price wrote:

[...]

> Then tried investigating thusly:
> 
> sudo mount -t ext2 -o loop soundserver.img /mnt/soundserver/
> 
> but it won't mount, giving a "wrong fs" error of the kind I've
> sometimes seen when forgetting to add "-t iso9660" while attempting to
> mount a cd.  so not sure whether I'm doing something wrong, or whether
> perhaps you use a special fs (reiser?)

You shouldn't need to specify the filesystem type; I'll bet what you
have is actually not a partition image, but a disk image.  This is
different: the disk image has a partition table in front of it, not
a filesystem.  You need to instruct mount to seek to the appropriate
partition within the disk image using the "offset" option.  First, do
this:

/sbin/fdisk -l soundserver.img

and see if you get a partition table.  If you do, then the above
diagnosis is correct.  In that case, here's a dirty little perl snippet
I have used to mount the first partition in a disk image.  You will have
to modify it if you want to specify a different partition.

#!/usr/bin/perl -w
@ARGV == 2     || die "$0: bad usage\n";
$f = shift;
$d = shift;
-f $f && -r $f || die "$0: $f: $!\n";
-d $d          || die "$0: $d: $!\n";

$ptable = qx(sfdisk -d "$f") || die "$0: sfdisk failed\n";
$ptable =~ m/^\s*${f}1\s+:\s+start=\s*(\d+)/m || die "$0: bad sfdisk output?";
#                    ^
# The partition to mount is hard-coded to "1" here.
$offset = $1 * 512;

exec "mount -o loop,offset=$offset $f $d";



Reply to: