Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trying to read a Mac-formatted drive on a PC. (solved!)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Fri Sep 30, 2005 5:05 am    Post subject: Trying to read a Mac-formatted drive on a PC. (solved!) Reply with quote

Hello all.

My old 7300 seems about to give up the ghost, so I'm scrambling to get its data onto other systems. I have an 80GB IDE drive that I need to extract some stuff from. It would seem to be a straightforward process: Put the drive in an external USB bay and attach that to a system that has USB storage and Mac partition table support. Unfortunately, the drive acquired two different partition tables, Mac and DOS (this was back in the days when I didn't know the difference between fdisk and mac-fdisk, if you're wondering). On the Mac, that wasn't a problem, since the kernel defaulted to reading the Mac partition table. On the PC, however, it's a problem; it apparently will only read the DOS table, which is useless to me.

Is there a way to force the PC to read the drive's Mac partition table, and mount partitions based on that table? Otherwise, is there a way to safely delete the DOS partition table from the drive while leaving the Mac partition table intact?

Thanks for any help.
_________________
Proud to be a... eh, forget it.

"Everyday is just one day." -- not the Traveling Wilburys


Last edited by skunkworx on Mon Oct 03, 2005 4:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
SnakeByte
Apprentice
Apprentice


Joined: 04 Oct 2002
Posts: 177
Location: Europe - Germany

PostPosted: Fri Sep 30, 2005 11:04 am    Post subject: Reply with quote

Hi skunkworx,


two possible options:

-> recompile the linux kernel without support for DOS partitions ( its somewhere in the filesystem stuff )

-> try to delete the DOS partition table from the old system


If you tell mount to use a mac partition type ( mount -t <type> )
does it still use the wrong partition table


regards
Back to top
View user's profile Send private message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Fri Sep 30, 2005 12:41 pm    Post subject: Reply with quote

SnakeByte wrote:

two possible options:

-> recompile the linux kernel without support for DOS partitions ( its somewhere in the filesystem stuff )


Since I'm on a PC, if I do that, I'll lose the ability to read my boot drive!

Quote:

-> try to delete the DOS partition table from the old system


Do you know how I can do that safely?

Quote:

If you tell mount to use a mac partition type ( mount -t <type> )
does it still use the wrong partition table


There are no Mac partition types on this drive, actually (none with real data on them, anyway). This was my linux data drive, so the partition I'm most interested in is an ext2 partition.

To answer your question a different way, the Mac partition table has three partitions, and the second one is the one I need to get at. The DOS partition table only has one partition. When I instruct my PC to try and mount that second partition, it just says that "special device" doesn't exist.
_________________
Proud to be a... eh, forget it.

"Everyday is just one day." -- not the Traveling Wilburys
Back to top
View user's profile Send private message
bruda
Guru
Guru


Joined: 06 May 2004
Posts: 376
Location: Sherbrooke, QC, Canada

PostPosted: Fri Sep 30, 2005 6:50 pm    Post subject: Reply with quote

skunkworx wrote:
To answer your question a different way, the Mac partition table has three partitions, and the second one is the one I need to get at. The DOS partition table only has one partition.

You can try to modify the DOS partition so that it becomes identical to the Mac partition. I have never tried this but it should work.
_________________
Quid latine dictum sit altum videtur
Back to top
View user's profile Send private message
zeekec
n00b
n00b


Joined: 24 Feb 2004
Posts: 56
Location: Athens, GA, USA

PostPosted: Fri Sep 30, 2005 6:57 pm    Post subject: Reply with quote

Have you tried hfsutils or hfsplusutils?

Erik

[edit] Ooops. Just remembered that its a ext2 fs. I have no idea if the hfs tools will help. [/edit]

[edit2] Have you tried using mac-fdisk to clean up the partitions? [\edit2]
_________________
Against stupidity the very gods
Themselves contend in vain.
-Johann Christoph Friedrich von Schiller (1801)
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Fri Sep 30, 2005 8:23 pm    Post subject: Reply with quote

Okay, the first 31.5k of the drive should be the mac partition table. The PC partition is also somewhere in there (probably in the first 512 bytes). What I would do is first, back up the entire drive with dd. Next, use mac-fdisk to write down the different partitions and the locations they are found on the disk. Next, write over the first 512b with 0's and then reboot to see if the PC partition is gone. Repeat until the PC partition is gone. If the Mac one is still working, then that's a bonus. :) If not, write a new one with mac-fdisk with your existing location info that you wrote down before.

Good luck!
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Fri Sep 30, 2005 8:45 pm    Post subject: Reply with quote

bruda wrote:
You can try to modify the DOS partition so that it becomes identical to the Mac partition. I have never tried this but it should work.


That sounds like a good idea. Unfortunately it seems mac-fdisk and fdisk use different block sizes, so I'm not sure how to make the partition boundaries line up. Anybody have any ideas? I'll do some more Googling.

zeekec wrote:
Have you tried hfsutils or hfsplusutils?

Erik

[edit] Ooops. Just remembered that its a ext2 fs. I have no idea if the hfs tools will help. [/edit]

[edit2] Have you tried using mac-fdisk to clean up the partitions? [\edit2]


HFS tools wouldn't help on an ext2 partition, no. mac-fdisk will display the Mac partition table, but it seems the two partition tables are mutually exclusive; modifying one has no effect on the other. So I still need a way of either deleting the DOS partition table entirely, or forcing my PC to mount partitions using the drive's Mac partition table (or lining the two partition tables up if I can get the numbers to play nice).

Edit: Sorry, JoseJX, didn't see your reply at first. That sounds doable. I'll have to give that a shot if nothing else comes up. Now where to find 65GB of space to do a back-up... :)
_________________
Proud to be a... eh, forget it.

"Everyday is just one day." -- not the Traveling Wilburys
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Fri Sep 30, 2005 9:08 pm    Post subject: Reply with quote

Well, the backup part falls in the "How much do I need this data" category. You could probably get away with just backing up the first 31.5K of the disk (the mac partition table / the part that you'll be messing with), but if you really care about your data, I'd do the whole drive. Another idea came to mind too: With an image of the disk, you can mount the image by offset (using the loop device). This would allow you to not make any changes to the disk/data, but still requires 65 gigs of free space somewhere. :)

Now, I'm not sure if it's possible, but perhaps you could try using a loop to mount the block device itself specifying the actual partition offset? Perhaps it's worth a shot...

Good luck!
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Fri Sep 30, 2005 9:46 pm    Post subject: Reply with quote

JoseJX wrote:
Well, the backup part falls in the "How much do I need this data" category. You could probably get away with just backing up the first 31.5K of the disk (the mac partition table / the part that you'll be messing with), but if you really care about your data, I'd do the whole drive.


I hear ya, and I think I know where I have the space. I can temporarily sacrifice my NTFS partition used for video editing under Windows.

Quote:

Another idea came to mind too: With an image of the disk, you can mount the image by offset (using the loop device). This would allow you to not make any changes to the disk/data, but still requires 65 gigs of free space somewhere. :)


That's an interesting idea. So I can feed mount the starting point at which to try and mount the dd'ed image? Would it need the ending point as well?

Quote:

Now, I'm not sure if it's possible, but perhaps you could try using a loop to mount the block device itself specifying the actual partition offset? Perhaps it's worth a shot...


Now that's funky. I'll try the other options first. :)

Thanks for the advice, it's much appreciated. At least now I have several options to play with.
_________________
Proud to be a... eh, forget it.

"Everyday is just one day." -- not the Traveling Wilburys
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Fri Sep 30, 2005 10:11 pm    Post subject: Reply with quote

The offset is just a starting offset, the filesystem itself knows its size and boundries.

Here's an x86 page that I found on google (I'm feeling lucky!), which should explain how loop mounting images works.
http://edseek.com/~jasonb/articles/linux_loopback.html

Have fun. :)
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Mon Oct 03, 2005 4:11 pm    Post subject: Reply with quote

I'm happy to say I was finally able to access the files on that drive, and have copied all the essential bits over to the PC's drive.

The solution was to zero out the first 512 bytes on the Mac drive. That wiped out the DOS partition table, while actually leaving the Mac partition table intact (or at least intact enough that it could still be read). Once I rebooted the PC, the kernel read the Mac partition table and I was able to mount the drive.

Things got scary for a while, because I had to do this without a back-up image. dd died with read errors about 40GB in. I then tried to move the drive from the USB external box to inside the PC, but for some odd reason that seemed to make matters worse. I kept getting read errors that looked like DMA-related problems, but changing or disabling DMA didn't help, which of course made me afraid that the drive was toast. But, once I moved the drive back to the USB box, it behaved itself again. I'm sure it's going to need a good reformatting, but hopefully it's still useable otherwise.

Now I need to go about putting together a new file server. Fortunately, I now have a Mac G3 tower to play with, found at a thrift store about a month ago for a paltry $35. I'm hoping Gentoo is more forgiving to the G3; the latest kernels and X.Org versions just didn't want to play nice with the 7300.

Thanks to everyone for replying, and especially to JoseJX for your invaluable help. It was much appreciated.
_________________
Proud to be a... eh, forget it.

"Everyday is just one day." -- not the Traveling Wilburys
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum