dd to the rescue… again!


( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.216917078532preg_replace ( )../wp-vimcolor.php:143
110.216917078668vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:1
120.226117094960fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.227317093456preg_replace ( )../wp-vimcolor.php:143
110.227317093624vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:3
120.234817095064fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.235517093396preg_replace ( )../wp-vimcolor.php:143
110.235517093532vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:1
120.243017094956fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.243917093624preg_replace ( )../wp-vimcolor.php:143
110.243917093812vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:3
120.251417095252fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.252017093396preg_replace ( )../wp-vimcolor.php:143
110.252017093532vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:1
120.259517094936fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.260417093396preg_replace ( )../wp-vimcolor.php:143
110.260417093532vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:1
120.267917094936fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.268417093400preg_replace ( )../wp-vimcolor.php:143
110.268417093540vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:1
120.275817094948fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153076{main}( )../index.php:0
20.000256516require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.171016858956require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.172516921536include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.207517040700the_content( )../single.php:16
60.207617046032apply_filters( )../post-template.php:169
70.216917060316call_user_func_array ( )../plugin.php:166
80.216917060500vim_color( )../plugin.php:0
90.216917060836preg_replace ( )../wp-vimcolor.php:143
100.276817094540preg_replace ( )../wp-vimcolor.php:143
110.276817095028vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:6
120.284517097088fread ( )../wp-vimcolor.php:105

On my laptop (a macbook), I dual boot between Mac OS X and Gentoo.
Up to last week I only booted into Mac OS X once a month to see if there were
any firmware updates (which only come in .dmg archives), so in fact I was
single booting Gentoo.

Last week, of course in front of a customer, grub failed for no apparent reason.
I just shut down my laptop cleanly in the morning and in the afternoon it
didn’t want to work any more. Luckily, I could still boot into Mac OS X, so
not all was lost.

When I realised that I couldn’t access my Linux partitions from within Mac OS
X (due to imcompatible partitioning scheme types (GPT <vs> MBR)), I knew this
problem wouldn’t be that easy to fix, especially because of this extra
handicap: no CD-drive to boot a Linux rescue CD from. I had the same DVD stuck
into my macbooks internal superdrive for over 4 months (yes, Thomas, this was your qeimc DVD :-p). After having it surgically
removed by S&S they told me I would never be
able to use my internal superdrive again, because the drive itself got
displaced so it doesn’t fit with the opening in the casing any more.

Another thing I suddenly realised was that I did have good backups of all my
data… but not of my working environment (/etc, dotfiles, $HOME/bin, …).
That made me really want to get my Gentoo working again.

First try: boot into a rescue system. I tried with two bootable USB disks,
which work nicely on another PC at the office. My macbook choked on both with a nice
“boot error”.

Second try was at Barcamp.
Thomas (another one) was so kind to bring along an
external firewire cd drive, so I could boot into a resuce system and fix my
grub. No candy. I sure got the live CDs (tried multiple ones) in my rEFIt boot manager, but actually booting from
one was too hard a task for mr. macbook.

Third try: to the rescue! Here’s what I did.


Disk: /dev/rdisk0       geometry: 9729/255/63 [156301488 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
 1: EE    0   0   2 -   25 127  14 [         1 -     409639] <Unknown ID>
 2: AF   25 127  15 - 1023 254  63 [    409640 -   60817408] HFS+
 3: 83 1023 254  63 - 1023 254  63 [  61227048 -   54685260] Linux files*
*4: 83 1023 254  63 - 1023 254  63 [ 115912308 -   40384077] Linux files*

I knew the start and size columns were expressed in sectors.

Then there’s . I knew I needed something like

The manual explains that works with 512-byte blocks. So I
only needed to figure out what the relation was between 512-byte blocks and
sectors. told me just that!

Filesystem              512-blocks     Used   Avail Capacity  Mounted on
/dev/disk0s2              60817408 54925160 5380248    91%    /

Seems like partition disk0s2 has 60817408 512-byte blocks and 60817408
sectors. Therefore 1 sector = 1 512-byte block.

The manual also told me that the start-column is 0-based
and the size-column 1-based. Bringing all this together brought me to


and yup… these dd images on elisa (another PC on our network) are
loop-mountable.

Okay, my laptop isn’t fixed yet, but now at least I can try out some things
without having to fear losing all my precious stuff! :-)

Add a Comment   Trackback  

Add a Comment