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

Re: "offline" install of Etch to SATA HDDs for MyBook World?



Hi,

Jonsen, Dan schrieb:
> Now I understand from
> Bill that this is an issue with this type of low-cost device in general...

Ah now I see.

> ARRAY /dev/md1 level=raid1 num-devices=2 UUID=65b1b98b:decc728b:491f46ad:3c042270
That's your / device

> ARRAY /dev/md2 level=raid1 num-devices=2 UUID=2495e6db:48618489:d25c3483:5b58781a
swap

> ARRAY /dev/md3 level=raid1 num-devices=2 UUID=8d59d685:7700be3c:04a497c3:c22647c9
/var

> ARRAY /dev/md4 level=linear num-devices=2 UUID=4f410dca:7a52c8cf:fa6c245a:79394f0a
/shares/internal

> I guess that either (1) this is a highly customized Linux distro from WD,

So do I.

> or (2) the ARM architecture doesn't use GRUB, because I can't find a grub.conf file.

Also true. GRUB version 1 (0.9x actually) is for i386/AMD64 only. Grub 2
is planned to be portable in future. Since they didn't even finish 1 by
today, I wonder if they'll ever finish 2.

>  Nothing for LILO, either.

Also LILO is a i386/amd64 program. Bootloaders for ARM are apex, u-boot,
or redboot.

>  Even running 'find / -name *linu*' logged in as root returned no results.

So the kernel most probably lies in flash rather than on the disk, which
is what I would expect on that kind of device.

Definitely no Linux I've ever seen.  I finally got the following from
dmesg (WD firmware 02.00.18):
> 
> <5>Kernel command line: mem=32M console=ttyS0,115200 root=/dev/md1 netdev=0,0,0x0090A945,0x4D4A,eth0

Here it says hat md1 is the root device, and fstab confirms that. Also
it says that the first serial port is the console. There is probably an
unwired serial port in that box somewhere.

So if you want to debianize this box, you could either leave flash
unchanged, and try if it runs if you replace the entire contents of md1
with a debootstrap, but leaving the original WD kernel in flash and
modules (/lib/modules) on disk. This would be nearly impossible without
serial port, because the first try willl probably fail, and you'll have
no output.

The other possible strategy would include messing with the contents of
flash ROM, that now probably contains a bootloader and the WD kernel,
that is making a debian kernel that will run on that box, and making it
boot somehow. For this kind of hacking, not only a serial console should
be there but also a JTAG interface. Messing with the bootloader is
likely to brick your device if you don't know exactly what you're doing.

For strategy 1, the way to get started is something like this: Create a
subdirectory on the existing 1TB disks, and from the PC, create a
debootstrap --stage1 in them. Then stick them into the MyBook, and run
stage 2 of the debootstrap. Then partition your new 160GB disks the way
you like, create the md devices with mdadm, format them with ext3, mount
them. Then move your debootstrap into there from the 1TB disks.

Afterwards, make a backup of what you've done so far, and of course a
backup of the existing root and var filesystems. After that you would
customize your debootstrap environment, for instance by copying
/lib/modules, fstab, ... into it, making sure that the rest of debian
will work with the existing kernel. Make sure that the UUIDs of your new
partitions are in /etc/mdadm.conf.

After that preparation comes the part with the serial console. Is there
anything in the device that looks like a serial port? Maybe the chip has
one that's just not wired. You can tell by the H/W specs. I wish I had
one... how much did it cost?

That said, I just found that someone has already done it:

http://www.ismprofessional.net/pascucci/documenti/mybook/mybook-hacking-en.html

So you won't necessarily need a serial console after all and won't need
to go through all the steps I mentioned, just follow his instructions,
and use the new disks where applicable.

Don't forget to backup, and if it breaks, you get to keep the bits...

cheers
-- 
Kevin Price
http://www.kevin-price.de/

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: