My fast and perfect setup of Debian Lenny into my 500GB World Book
Forum » Forum / Using and installing other OS's » My fast and perfect setup of Debian Lenny into my 500GB World Book
Started by: gsamgsam
On: 1197340701|%e %b %Y, %H:%M %Z|agohover
Number of posts: 30
rss icon RSS: New posts
My fast and perfect setup of Debian Lenny into my 500GB World Book
gsamgsam 1197340701|%e %b %Y, %H:%M %Z|agohover

**based on this site and all the most wanted information i found in here……
nice work…keep on…..

p.s.
i used an external usb2 sata box …so my dev is /dev/sdd

sudo -s into terminal…very important..!!! … must be root all the time….
i used the /root/Debian-WD/ directory for working directory….in here are all the
files from the http://www.ismprofessional.net/pascucci/index.php/mybook-repository/

if you have problems with the mbr file…like permition deniyed… ;) check your file permitions into the /root/Debian-WD/

have fun… ;)**

INSTALLATION…..
1.zerofill MBR and partitions (count=10000 —-> 10GB of disk space)

dd if=/dev/zero of=/dev/sdd bs=1M count=10000

2.partitioning the sdd

fdisk /dev/sdd

First cylinder (1-60801, default 1): 673
Last cylinder or +size or +sizeM or +sizeK (673-60801, default 60801):
Using default value 60801

Command (m for help): p

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfdcdfaf1

Device Boot Start End Blocks Id System
/dev/sdd1 2 655 5253255 83 Linux
/dev/sdd2 656 672 136552+ 82 Linux swap / Solaris
/dev/sdd3 673 60801 482986192+ 83 Linux

TwonkyMedia

3.read the empty MBR

dd if=/dev/sdd of=mbr bs=512 count=1

4.modify the mbr saved file

./installer mbr

5.write the mbr back to disk

dd if=mbr of=/dev/sdd bs=512 count=1

6.install the first stage bootloader
TwonkyMedia
dd if=stage1.bin of=/dev/sdd bs=512 seek=1

7.install the second stage bootloader

dd if=u-boot.img of=/dev/sdd bs=512 seek=64

8.format the /dev/sdd1 with ext3 and make it clean for fsck at boottime…

mkfs.ext3 -L MyBook_root /dev/sdd1
e2fsck -fDy /dev/sdd1

--> check that the filesystem is clean and has date fixed to real one
tune2fs -l /dev/sdd1

!!! finaly overide checking filesystem at first book !!!

tune2fs -c -1 -i 0 /dev/sdd1
TwonkyMedia

9.format the /dev/sdd3 with ext3 and make it clean for fsck at boottime…

mkfs.ext3 -m0 -L MyBook_home /dev/sdd3
e2fsck -fDy /dev/sdd3

--> check that the filesystem is clean and has date fixed to real one
tune2fs -l /dev/sdd1

!!! finaly overide checking filesystem at first boot !!!

tune2fs -c -1 -i 0 /dev/sdd3

10.make /dev/sdd2 as swap memory

mkswap -L MyBook_swap /dev/sdd2

11. mount the 500GB disk to a folder and cd to it

mkdir /media/MyBook
mount /dev/sdd1 /media/MyBook
mkdir /media/MyBook/home
mount /dev/sdd3 /media/MyBook/home
cd /media/MyBook/

12.install the base system

tar xjf /root/Debian-WD/mybook-rootfs-debian-20070826.tar.bz2

13.install the kernel

tar xzf /root/Debian-WD/kernel-2.6.17.14-20070817-mybook.tar.gz

14.unmount all partitions..very inportand !!!!

cd /
umount /dev/sdd3
umount /dev/sdd1

15.poweroff usbbox….unmount the diskdrive….mount the World Book with the drive…blablabla…

16.poweron the World Book…wait to see all the blue leds on….open a term into your desktop pc…and…

ssh 66.1.861.291|toor#66.1.861.291|toor
pass:mybook

then clear ssh key and generate new…
cd /etc/ssh
rm ssh_host_dsa_key
rm ssh_host_dsa_key.pub
rm ssh_host_rsa_key
rm ssh_host_rsa_key.pub

then type into ssh on your MyBook…
reboot

then restart your router and the dls line….then restart your desktop pc… to get new IPs and fix the new ssh keys….
then type… rm -r -f /root/.ssh
(/root is my working directory and do this to clear /root/ssh/ key directory that is stored into your desktop pc.. you will NOT be able to login to MyBook with old keys…!!!)

finaly wait all the restarts to be done and type into term on your desktop pc…
sudo -s
pass:xxxxxxxxxx (..your password)
ssh 56.1.861.291|toor#56.1.861.291|toor (go at your router site and find out the new IP of yours MyBook… i have 192.168.1.65 and it is static…later we will make it DHCP)

DONE..!!!!

17…where to go now…..

nano /etc/fstab….

#mybook base fstab
/dev/root / ext3 defaults 0 0
/dev/sda2 swap swap defaults 0 0
/dev/sda3 /home ext3 defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0

nano /etc/hosts
#mybook host file
127.0.0.1 localhost
127.0.1.1 mybook.lan mybook
#router
192.168.1.254 speedtouch
#desktop pc
192.168.1.64 1711smi

reboot your MyBook by entering into ssh shell…
reboot

edit your /etc/hosts of your desktop pc and add line …(as root always…)

nano /etc/hosts

127.0.0.1 localhost
127.0.1.1 1711smi.lan 1711smi
#The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.1.65 mybook <--------—-
192.168.1.254 speedtouch

!!!!reboot your desktop pc….!!!
reopen a new term…
sudo -s

then relogin to your mybook…
ssh root@mybook (..nice to have a name than a IP adress… ;) )

18.working into your new debian lenny…..

nano /etc/apt/source.list
prefer a server near you….i am in greece so…
deb http://ftp.gr.debian.org/debian/ lenny main contrib non-free

….update your debian repository and debian distro to latest …(tip: is your dsl up? )
apt-get update
apt-get install aptitude (tip: never mind about locales error mesages..we will fix it later..)
aptitude update
aptitude dist-upgrade

….fix locales
aptitude install locales
dpkg-reconfigure locales (tip:select only locales you need and default language en_US)

….timezone,date and clock settings
nano /etc/default/rcS
..and type no at "UTC=yes"
reboot
….exit all terminals..wait your MyBook to get up..open a new term..sudo -s for root… ssh root@mybook
….check date
….fix it
cp /usr/share/zoneinfo/Europe/Athens /etc/localetime
date MMDDhhmmYYYY
….check date again
date

…./etc/fstab modify for noatime
nano /etc/fstab
#mybook base fstab
/dev/root / ext3 defaults,noatime 0 0
/dev/sda2 swap swap defaults 0 0
/dev/sda3 /home ext3 defaults,noatime 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0

….add same tools
aptitude install nano openssh-server mc screen sysv-rc-conf elinks (tip: aptitude create database of installed pakages…apt-get not)
sysv-rc-conf:tool for servises only change 2 3 4 5 colums..not 1 0 6 s (tip: bootclean at 2 3 4 5)
mc: nice file manager like norton commander….
elinks: nice text web browser

Last edited on 1197418884|%e %b %Y, %H:%M %Z|agohover By gsam + Show more
Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
PhoTonicPhoTonic 1200416486|%e %b %Y, %H:%M %Z|agohover

It does not seem like you used any serial communication to the box? You only did the work on the disk and replaced the HDD's and booted it up while checking with the router what IP it has?

And do you have the steps for "12.install the base system" and "13.install the kernel" ? is at simple as copying the files of to the target HDD?

Last edited on 1200416681|%e %b %Y, %H:%M %Z|agohover By PhoTonic + Show more
Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
PhoTonicPhoTonic 1200426797|%e %b %Y, %H:%M %Z|agohover

I also get:
./installer mbr
FATAL: kernel too old
Segmentation fault

Please help

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
PhoTonicPhoTonic 1200429339|%e %b %Y, %H:%M %Z|agohover

Hey dude, this forum is really DEAD! Lucky your a smart one.. you have to compile your own installer from the "buildroot".

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
fabrice regnierfabrice regnier 1205363028|%e %b %Y, %H:%M %Z|agohover

Hi and first thanx for your explanations ;)

I bought a small sata hard disk to test your tutorial (250GB).

First, i used the http://mybookworld.wikidot.com/rescue-procedure with this disk and it worked ok.
Second step, i tried to install lenny on that disk.

I followed your lines, downloaded the files, checked the md5, worked as root, …
At the end, when i connect to the NAS, it doesn't boot. It seems to have a problem with mbr or stage bootloader.

I guess you'll tell me to connect a serial cable…

Does someone have any clue ?
Will be it better if compiling all the stuffs ?

thanx in advance,

regards,

f.

Reply  |  Options
[SOLVED] Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
fabrice regnierfabrice regnier 1205943532|%e %b %Y, %H:%M %Z|agohover

Hi all,

Ok, my debian box is up :)

Strange though:
I tried many times from a debian lenny laptop with 2.6.22-3-686 kernel. The drive was seen as sda.
Then, i tried with ubuntu gutsy client. Drive seen as sdb. And everything went ok.

regards,

f.

Reply  |  Options
Re: [SOLVED] Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
kennykwokkennykwok 1225763357|%e %b %Y, %H:%M %Z|agohover

I also use the 250GB HD, but can not boot ,

can you provide the steps

Thanls

Kenny

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
nsinensine 1206474511|%e %b %Y, %H:%M %Z|agohover

Hey,

I have the same problem with not booting.. did you found a solution?

[FIXED] "and when i make the partitions on the disk, then write them to it and reboot the partitions are gone … :s " [/FIXED]

help??

Last edited on 1206474890|%e %b %Y, %H:%M %Z|agohover By nsine + Show more
Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
mozettimozetti 1205998382|%e %b %Y, %H:%M %Z|agohover

What benefits are there in installing Debian? I understand the repositories have a ton more software available, but are there speed increases, or anything that would make it worth the effort to switch from the WD Linux to Debian?

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
fabrice regnierfabrice regnier 1206051478|%e %b %Y, %H:%M %Z|agohover

Hi ;)

I have 2 major reasons to switch to debian with that NAS:

1) Debian is the one i use on all my servers (at home & at work)
2) Well, it was quite fun to loose so much time to make it working on 500 GB WB ;)

…I'm really wonder what i gonna fuck around now, maybe i'll have a look towards debootstrap, i'd love to build a debian system on the WB with ssh access only.

regards,

f.

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
mozettimozetti 1206084026|%e %b %Y, %H:%M %Z|agohover

Ok, that's what I suspected. No big performance improvements, just something that is fun to do.

At some point I might follow your tutorial (or if you get the ssh-only install working, I'd prefer that). Right now I'm busy trying to sort out exactly how this WD-linux handles all the folders/permissions. My aim is to get it easily accessible via NFS, Samba, FTP, and rsync while building in the appropriate security using users/groups permissions.

Thanks for the tutorial.

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
exdm69exdm69 1245252020|%e %b %Y, %H:%M %Z|agohover

I have a similar problem to some of the guys above, my MyBook does not boot. I took the MyBook's hard drive out, put it in my linux box and went through the procedure, set up partitions, mbr, stage 1 & 2 bootloaders, created filesystems, extracted the rootfs and kernel tarballs into my root partition (first partition on the disk).

When I put the HD back in my MyBook and attached the power cable, it powered up, then the hard disk is busy for a second (probably the stage1 & 2 bootloaders, then the kernel loads) then a brief moment of less activity (kernel initialization?) and then some more HD activity (start of init?). No blue LEDs come up and I can't see the device in my router's DHCP clients list. The LAN cable leds flash occasionally.

I tried a bunch of hacks. First I tried changing /etc/fstab and /etc/mtab to have /dev/sda1 instead of /dev/root, I checked that /lib/modules/2.6.17.14-20070817-mybook/modules.dep has absolute paths to the correct directory. I also tried setting up a static IP address in /etc/network/interfaces, which didn't help (but my router's Address Resolution Protocol Cache (ARP) says MAC Address 00:00:00:00:00:00 = IP Address 192.168.1.50, which is the same as the IP I tried). I also tried with the bootable flag on the root partition set on and off. I also read that someone's MyLenny-based setup hanged in checkfs.sh during the boot and removing the script file helped, so I tried removing it and that didn't help either. I also e2fsck'd the partitions and used tune2fs to disable routine e2fsck checks.

Has anyone found a solution to their booting problems?

I've seen several accounts of similar behavior on the net, all of them are very recent. Could this be an issue caused by a newer version of hardware? I bought mine in mid-2008.

Any help appreciated,
-Riku

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
PhoTonicPhoTonic 1198860894|%e %b %Y, %H:%M %Z|agohover

Hi!

Nice work.

Last edited on 1200415842|%e %b %Y, %H:%M %Z|agohover By PhoTonic + Show more
Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
onebitonebit 1201966220|%e %b %Y, %H:%M %Z|agohover

To have a working power button

/etc/modules
wdc-leds
m41t00
ehci-oxnas
power_button invert_leds=1

kernel .config
CONFIG_OXNAS_POWER_BUTTON_GPIO=4

/etc/inittab
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now

patch arch/arm/mach-oxnas/power_button.c to have
kill_proc(1, SIGINT, 1);

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
LiNoLiNo 1202242039|%e %b %Y, %H:%M %Z|agohover

Hi,
I'm a complete Linux noob. I managed to install Debian Lenny on a MBWE using the guide above. I would like to enable power button but I'm a bit confused with the patching stuff :

patch arch/arm/mach-oxnas/power_button.c to have
kill_proc(1, SIGINT, 1);

What do I have to do, how do I do it and what do I need?

Thanks

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
anandusanandus 1204246769|%e %b %Y, %H:%M %Z|agohover

Just wanted to say the tutorial works like a charm.
(although I don't know what those twonkymedia words are doing there. Subliminal messaging? :P )

I've got a very nice fully working Debian machine. Feels good :)

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
anandusanandus 1205172808|%e %b %Y, %H:%M %Z|agohover

I've got a question:
I want to have a virgin-like clean Mybook again, it's full of crap and half-compiled programs and such.

How can I get a brand-new-like setup? Preferably without removing the hard disk.

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
jijabytejijabyte 1205334930|%e %b %Y, %H:%M %Z|agohover

pretty sure you have to remove the disks for that.

It is very easy to restore to original using partition images that are available, pull the drive hook it up, use knoppix or some other live cd and bob is your uncle who spells his name backwards!!

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
jijabytejijabyte 1205335341|%e %b %Y, %H:%M %Z|agohover

Hello,

I now have debian installed on my 1TB world edition.. however im not quite sure on how to do the power button patch. I have bolded my questions to see if anyone could help me out.

To have a working power button
Ill assume this is just edit with nano, joe or other editor
/etc/modules
wdc-leds
m41t00
ehci-oxnas
power_button invert_leds=1

dont know what this is, or where to start on this one
kernel .config
CONFIG_OXNAS_POWER_BUTTON_GPIO=4

Ill assume this is edit with an editor as well
/etc/inittab
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now

no idea what to do here?
patch arch/arm/mach-oxnas/power_button.c to have
kill_proc(1, SIGINT, 1);

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
alllexxalllexx 1244363734|%e %b %Y, %H:%M %Z|agohover

I haven't installed Debian on my WD, but I got power button working fine on my custom firmware. You don't need to edit the kernel config for that - ‘make CROSS_COMPILE=arm-linux- oxnas_wd2nc_defconfig` will give you the right settings. Just don’t disable Leon support.
If building kernel fails, then, following step 7 of the original HowTo, get leon-program.h and leon-power-button-prog.h. Copy them to linux-kernel/asm/arch and it should build fine.

Hera are the headers I used building my FW:
http://mybookworld.wikidot.com/local--files/ldso-runpath-enabled-firmware/leon-program.h
http://mybookworld.wikidot.com/local--files/ldso-runpath-enabled-firmware/leon-power-button-prog.h

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
paultje3181paultje3181 1241600438|%e %b %Y, %H:%M %Z|agohover

I tried to install Debian on my mybook, but it doesn't boot. No rings come up, and neither does internet. I followed the steps to number 16. Any clues on how to make it work? Do the partition have to have a bootable flag (right now, they don't), in /etc/fstab /dev/root is listed, is this ok? Or should this be /dev/sda1? Anyone have any clues?

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
swagswag 1241629829|%e %b %Y, %H:%M %Z|agohover

I have the same problem and am trying to resort to soldering in a serial connector, if I can figure out how. I read somewhere else that you do not want to set the bootable flag when you are connected to the drive on a USB cable; that makes sense anyway, since your host will possibly think it is the bootable partition for it instead of the MBWE. I will try to check my own device tonight for that /dev/root; that does sound suspicious.

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
paultje3181paultje3181 1241633535|%e %b %Y, %H:%M %Z|agohover

In a topic about u-boot it mentioned that this acts as a bootloader and that root=/dev/sda1 option is given. So this might be right, but normally it don't appear in a linux-installation.

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
kevkukevku 1241680902|%e %b %Y, %H:%M %Z|agohover

try and build u-boot with netconsole? it could save you from the serial if you get it working.


30-day pro trial.
2x WD Caviar SE WD5000AAJS RAID0 MBWEII
don't click

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
jaydoubleyoujaydoubleyou 1244361878|%e %b %Y, %H:%M %Z|agohover

I followed the steps above, booting from Ubuntu on a USB stick. Put the disk back into the enclosure, connected the power then it does something odd. None of the lights in the ring come on but I can hear the disk spin up, then 30 seconds spin down again. 10 seconds after that it sounds like it's booting again, but this time it seems to stay up (i.e. I can hear the disk spinning, but again no lights). However it does not appear on my network at all.
Any thoughts a) on why it's booting up twice and b) why it's not appearing on the network? The blue rings I can live without.

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
alllexxalllexx 1244364203|%e %b %Y, %H:%M %Z|agohover

It's hard to tell what exactly went wrong, but you should verify whether you installed the kernel modules. Also, check <your_mounted_WD_rootfs>/lib/modules/2.6.17.14/modules.dep. It should contain full paths, like '/lib/modules/2.6.17.14/kernel/arch/arm/mach-oxnas/wdc-fan.ko:', not 'kernel/arch/arm/mach-oxnas/wdc-fan.ko:'
(to fix this just do `sed -i -e "s|kernel/|/lib/modules/2.6.17.14/kernel/|g" <your_mounted_WD_rootfs>/lib/modules/2.6.17.14/modules.dep`)

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
jaydoubleyoujaydoubleyou 1244400137|%e %b %Y, %H:%M %Z|agohover

I've gone through the process again, the kernel appeared to install OK (step 13) and the modules.dep file is full of paths starting '/lib/modules…' as detailed above, but it's doing the same thing. Is there anything else I can check, or other steps to follow?

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
sany_vsany_v 1255789721|%e %b %Y, %H:%M %Z|agohover

i have same problem with no booting linux, i make reinstal many times from different linux os.

After that i made serial cable and connet to my linux PC, and what i saw:
$ NASOx_0800
dom lug 22 19:36:28 CEST 2007

U-Boot 1.1.2 (Jul 23 2007 - 13:53:26)

U-Boot code: 48D00000 -> 48D17658 BSS: -> 48D1B2C8
RAM Configuration:
Bank #0: 48000000 32 MB
*** Warning - bad CRC, using default environment

Boot reached stage -1
In: serial
Out: serial
Err: serial
Initialising disks
No FIS received from device 1
Detecting SATA busses:
Bus 0: Found first device OK
Device 0: Model: HTS721060G9SA00 Firm: MC3OC10H Ser#: MPCC11Y3G3HW0C
Type: Hard Disk
Supports 48-bit addressing
Capacity: 57231.5 MB = 55.8 GB (117210240 x 512)
Device 1: not available

IDE read: device 0 block # 63, count 1 … 1 blocks read: OK
Hit any key to stop autoboot: 0

0 bytes read
Boot reached stage 1
## Booting image at 48500000 …
Bad Magic Number
Boot reached stage -1

Any ideas, what do next?

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
sany_vsany_v 1255807733|%e %b %Y, %H:%M %Z|agohover

I found problem.

Problem was in file system atribute & feature , u-boot support only i-node size 128 not more , when you make fs check that you FS support same Feature like original on wd mybook:
Filesystem features: has_journal filetype sparse_super large_file
….
Inode size: 128
….
other case u-boot can't see rootfs & kernel (uImage)

Reply  |  Options
Re: My fast and perfect setup of Debian Lenny into my 500GB World Book
cma123cma123 1257686320|%e %b %Y, %H:%M %Z|agohover

Thanks sany_v,

this solves my problem. ;-)

Reply  |  Options
New Post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License