Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mac Partition Trouble [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
ranger719
Tux's lil' helper
Tux's lil' helper


Joined: 16 May 2006
Posts: 92
Location: Germany

PostPosted: Sun Aug 06, 2006 4:21 pm    Post subject: Mac Partition Trouble [SOLVED] Reply with quote

Hi there.
Yesterday I updated my kernel from gentoo-2.6.15xx to gentoo-2.6.17-r4. After a reboot nothing happened. My iBook G4 told me there is nothing to boot from (with this little "?-Icon"). Ok, I thought "ybin -v" did something bad. Maybe an update accidently overwrote my yaboot.conf. So I booted from a Gentoo-LiveCD. This worked. But I am unable to mount my root-dir (and all the others). So I fired up mac-fdisk. Here is the output:

Code:

livecd ~ # mac-fdisk /dev/hda -l
/dev/hda
        #                    type name                  length   base      ( size )  system
/dev/hda1    Apple_partition_map Apple                     63 @ 1         ( 31.5k)  Partition map
/dev/hda2               Apple_HFS Apple_HFS_Untitled_2  20447232 @ 262208    (  9.8G)  HFS
/dev/hda3         Apple_Bootstrap bootstrap               1600 @ 64        (800.0k)  NewWorld bootblock
/dev/hda4         Apple_UNIX_SVR2 swap                 3090608 @ 20709440  (  1.5G)  Linux swap
/dev/hda5         Apple_UNIX_SVR2 root                20971520 @ 23800048  ( 10.0G)  Linux native
/dev/hda6         Apple_UNIX_SVR2 /root                 409600 @ 44771568  (200.0M)  Linux native
/dev/hda7         Apple_UNIX_SVR2 log                   819200 @ 45181168  (400.0M)  Linux native
/dev/hda8         Apple_UNIX_SVR2 tmp                  4194304 @ 46000368  (  2.0G)  Linux native
/dev/hda9         Apple_UNIX_SVR2 test                67110320 @ 50194672  ( 32.0G)  Linux native
/dev/hda10             Apple_Free Extra                 260544 @ 1664      (127.2M)  Free space

Block size=512, Number of Blocks=117304992
DeviceType=0x0, DeviceId=0x0

All fine. Looks like it should be (test is encrypted home, root is reiserfs, tmp is encrypted, swap ist encrypted, log and /root are ext2). But I can only access /dev/hda /dev/hda1 and /dev/hda2 (But I cannot mount them). No sign of the others. Odd, I thougt. I rewrote the partition table (createt a small partition in the free space so I was able to write the "new" table). Then I rebooted. When I press alt on startup my IBook shows my MAC OS X and my Linux partition to boot from. MAC OS X works fine, yaboot works fine, but all my kernel get a panic because they fail to access the root-directory. The MAC OS X Install CD only sees TWO partitions. Inside Mac OS X (bootet from hd) I see all partitions as reported by mac-fdisk. So, after a while I fired up fdisk /dev/hda from the live cd. Surprise surprise:
Code:

livecd ~ # fdisk -l /dev/hda

Disk /dev/hda: 60.0 GB, 60060155904 bytes
255 heads, 63 sectors/track, 7301 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        3650    29318593+  83  Linux
/dev/hda2            3651        7301    29326657+  83  Linux

Then I remembered. A few days ago I partitioned an external usb-drive, with fdisk (not mac-fdisk). Yes, I createt two partions. Exactly that size. I must have createt the partitions on hda and not on sda. I know I did it twice because I was unable to format them. Now I know why. Have not rebooted until now.

So, I have a mac-partition table and a "normal-pc-partition-table". I can boot MAC OS X but Linux won't boot.
How do I solve this? Should I just create a new table with fdisk that looks like my mac-table? Can I do this because there is no extended partition? Can I repair the table? Maybe delete all pc-partitions?

Thanks in advance.


Last edited by ranger719 on Sun Aug 06, 2006 8:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Sun Aug 06, 2006 7:08 pm    Post subject: Reply with quote

This comes up once in a while, but it's fixable. :)

The first thing to do is to make sure that you have the existing partitions extents, which you do since they're posted here. This is more of a backup than anything.

To get rid of the x86 partition map:
Code:

# dd if=/dev/zero of=/dev/hda bs=512 count=1


This will overwrite the first 512 bytes of your disk with 0's and should remove the x86 partition map. Reboot into your system to make sure it's gone. Sometimes this messes up the Mac partition as well. If so, remake your partitions with Mac fdisk (make sure to use the *exact* same extents as before) and everything should be okay.

Good luck!
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml


Last edited by JoseJX on Sun Aug 06, 2006 10:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
ranger719
Tux's lil' helper
Tux's lil' helper


Joined: 16 May 2006
Posts: 92
Location: Germany

PostPosted: Sun Aug 06, 2006 8:11 pm    Post subject: Reply with quote

Yes that worked. Thanks!
But, it is /dev/zero, not /dev/null. But i guess this is a common "mistake" :)
After zeroing the x86-table I had to reboot once again from the livecd and rewrite the mac-partion-table one more time. Without that nothing bootable was found.
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Sun Aug 06, 2006 10:23 pm    Post subject: Reply with quote

Sorry about that, I typoed :p

Glad to see it worked for you.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Thu Aug 10, 2006 5:04 am    Post subject: Reply with quote

to write zero's the the in file would be /dev/zero, to read and throw it away would be to set the out file to /dev/null

matt
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