POV-Ray : Newsgroups : povray.off-topic : A small challenge : Re: A small challenge Server Time
28 Jul 2024 12:24:24 EDT (-0400)
  Re: A small challenge  
From: Le Forgeron
Date: 1 May 2014 14:38:40
Message: <536294b0@news.povray.org>
Le 01/05/2014 20:16, Orchid Win7 v1 nous fit lire :
> Does anybody here know how to read C?
> 
> Basically, my problem is this:
> 
> root# fdisk -l /dev/sdc
> 
> Disk /dev/sdc: 320.1 GB, 320072932864 bytes
> 255 heads, 63 sectors/track, 38913 cylinders, total 625142447 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x00000000
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sdc1              63      128519       64228+  af  HFS / HFS+
> root# mount /dev/sdc1 /mnt
> root# echo $?
> 0
> root# umount /mnt
> root# mount --ro -o offset=32256,sizelimit=6576994 /dev/sdc /mnt
> mount: wrong fs type, bad option, bad superblock on /dev/loop20,
>        missing codepage or helper program, or other error
>        In some cases useful info is found in syslog - try
>        dmesg | tail or so
> root# dmesg | tail
> [164258.208493] hfs: unable to find HFS+ superblock
> [164398.983651] hfs: invalid secondary volume header
> [164398.983654] hfs: unable to find HFS+ superblock
> [164404.235785] hfs: invalid secondary volume header
> [164404.235787] hfs: unable to find HFS+ superblock
> [164407.461400] hfs: invalid secondary volume header
> [164407.461404] hfs: unable to find HFS+ superblock
> 
> In order words, if I mount /dev/sdc1, it works perfectly. But if I mount
> /dev/sdc, passing in the byte offsets to the start and end of the first
> partition, it doesn't work at all.

And why do you want to use sdc instead of sdc1 ?

Offset seems an option for the loop device only (aka: the disk is
actually a file). Never heard of it for normal disk. Same for sizelimit.


> 
> By pointing my web browser at kernel.org and wandering aimlessly through
> the Linux kernel source code, I was eventually able to discover that the
> first message ("unable to find HFS+ superblock") appears on line 410 of
> fs/hfsplus/super.c - which seems like a logical enough place for
> superblock-reading code to live.
> 
> My question: Can anybody figure out why the code is actually failing?
> What is it unhappy about? What has it expecting to find that wasn't
> there? (I guess it's kinda hard to conclusively pin this down without a
> copy of the disk...)
> 

Mount is tricky, but it's nothing when compared to fsck mega jumbo
trampoline.

the option for hfs are only (from man page): creator, uid, dir_umask,
file_umask, umask, session, part and quiet.

If you really want to access the content from /dev/sdc, you would need
first to copy it as a file (on another bigger disk) (with
"dd if=/dev/sdc of=whatever_file_not_on_sdc" ), and then

mount -t hfs -o ro,loop,offset=32256,sizelimit=6576994
/whatever_file_not_on_sdc /mnt

(absolute path of the file is needed by mount)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.