Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing Gentoo to external Firewire
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
mzwier
n00b
n00b


Joined: 18 Jul 2003
Posts: 7

PostPosted: Thu Dec 18, 2003 10:38 pm    Post subject: Installing Gentoo to external Firewire Reply with quote

Hello all,

I'm attempting to install Gentoo-PPC to my brand-new WD firewire 120GB. I have a 15" PowerBook, and I know the firmware supports booting from firewire drives. I can boot the LiveCD just fine, and (with some tweaking) recognize the firewire drive, but only as a SCSI generic device! Is there something else I have to do to get it recognized as a block device?

The steps I've taken:
1) Installed ieee1394, ohci1394, and sbp2 modules
2) echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi
3) Gone completely bonkers because /dev/sg0 appears but /dev/sda doesn't.

Dmesg indicates no errors. cdrecord -scanbus shows the stupid thing as a disk, too.

Any thoughts?
Back to top
View user's profile Send private message
g-rem
n00b
n00b


Joined: 15 Nov 2003
Posts: 30
Location: France

PostPosted: Fri Dec 19, 2003 10:14 am    Post subject: Reply with quote

Hello,

Try running rescan-scsi-bus.sh
Back to top
View user's profile Send private message
mzwier
n00b
n00b


Joined: 18 Jul 2003
Posts: 7

PostPosted: Fri Dec 19, 2003 6:01 pm    Post subject: rescan scsi Reply with quote

I already did. That's what makes it a sg device instead of nonexistant.
Back to top
View user's profile Send private message
cselkirk
Apprentice
Apprentice


Joined: 09 Jun 2003
Posts: 199
Location: NL

PostPosted: Fri Dec 26, 2003 3:02 am    Post subject: No booting from external firewire devices .. Reply with quote

You can't presently boot from external firewire devices under linux .. I believe it's some OpenFirmware limitation.
_________________
cn=cselkirk,dc=xs4all,dc=nl
Back to top
View user's profile Send private message
mzwier
n00b
n00b


Joined: 18 Jul 2003
Posts: 7

PostPosted: Fri Dec 26, 2003 5:22 am    Post subject: Umm.. Reply with quote

cselkirk,

This is a linux-only problem? I can boot MacOS just fine from the drive.
Back to top
View user's profile Send private message
cselkirk
Apprentice
Apprentice


Joined: 09 Jun 2003
Posts: 199
Location: NL

PostPosted: Fri Dec 26, 2003 1:04 pm    Post subject: Re: Umm.. Reply with quote

mzwier wrote:
This is a linux-only problem? I can boot MacOS just fine from the drive.

Yes. I can't remember the exact details, some problem mapping the device-tree from OF.
_________________
cn=cselkirk,dc=xs4all,dc=nl
Back to top
View user's profile Send private message
fw146
n00b
n00b


Joined: 29 Dec 2003
Posts: 42

PostPosted: Mon Dec 29, 2003 5:16 pm    Post subject: Not true Reply with quote

I have read this before, but this is simply not true. Atleast on my ibook G3/firewire I have been using gentoo on an external firewire drive for almost a year now. In fact I tested it on two different drives and both worked fine.
In an earlier post, someone mentioned that yaboot has to be on the internal disk. That is also not true, for I have not modified my internal drive at all. Everything is on the external drive.
The OF problem is there, in the sense that an appropriate alias is not defined for a firewire disk, and you have to go into OF prompt to get the complete path. This path was slightly different for the two drives I used, so when I switched, I had to appropriately edit the yaboot.conf

I do not have the ibook with me right now, but I will bring it in tomorrow and provide more details. As you need to rescan the scsi bus, to be able to boot from the external disk, you will need to create an appropriate initrd.

Finally about to your problem, I guess that the livecd you are using (1.4 perhaps?) does not have the scsi hard disk support compiled into it's kernel. I had the same problem with 1.4_final. Although I did not investigate it in any depth, the relevant support is not even compiled in as a module. An earlier livecd (livecd-ppc-231202 or possibly livecd-ppc-281202) worked fine for me.
Back to top
View user's profile Send private message
fw146
n00b
n00b


Joined: 29 Dec 2003
Posts: 42

PostPosted: Tue Dec 30, 2003 9:24 pm    Post subject: Here goes.... Reply with quote

Dear mzwier,

I can no longer find the iso image I had used (livecd-ppc-281202) on the mirrors. If memory serves right, even the 1.2 livecd recognizes the external firewire disk as sd#. The firwire support on both of them is a bit flaky, but you just need them for setting up the system upto compiling your own kernel.You don't need to install gentoo_1.2, you just need a livecd which recognizes the firewire disk as scsi-disk. Once you see the drive as a scsi disk, you can follow the PPC install intructions (including GRP install instrutions).

I will divide the steps necessary to boot from an external disk into two phases.
Kernel and initrd stuff
While compiling the kernel make sure that following config options are set
Code:
SCSI Support-->SCSI disk support [M]
IEEE 1394 (FireWire) support (EXPERIMENTAL)-->IEEE 1394 (FireWire) support (EXPERIMENTAL)[M]
IEEE 1394 (FireWire) support (EXPERIMENTAL)-->OHCI-1394 support[M]
IEEE 1394 (FireWire) support (EXPERIMENTAL)-->SBP-2 support (Harddisks etc.)[M]

I think you can compile them into the kernel, but modules work better for me. Though in my current kernel
Code:
uname -r
2.4.21-ben2

I do not have any problems after a successful boot, the firewire drivers sometimes fail to initialize properly. Thus compiling them as modules help me in locating the problem easily.

Next you have to make an initrd. I did not find a mkinitrd utility on gentoo. As a initrd image was available on the livecd, I just used it to populate my initrd. Then copy over the relevant modules to initrd's /lib and finally edit the linuxrc.
The commands for this may look something like this
Code:
cp /mnt/cdrom/livecd.img /mnt/gentoo/root/initrd_stuff/initrd.img.gz
cd  /mnt/gentoo/root/initrd_stuff
gunzip initrd.img.gz
mkdir initrd_mnt
mount -o loop initrd.img initrd_mnt
cp /mnt/gentoo/usr/src/linux/drivers/scsi/sd_mod.o initrd_mnt/lib/
cp /mnt/gentoo/usr/src/linux/drivers/ieee1394/ieee1394.o initrd_mnt/lib/
cp /mnt/gentoo/usr/src/linux/drivers/ieee1394/ohci1394.o initrd_mnt/lib/
cp /mnt/gentoo/usr/src/linux/drivers/ieee1394/sbp2.o initrd_mnt/lib/
vi initrd_mnt/linuxrc
umount initrd_mnt
gzip initrd.img


For your reference, this is how my linuxrc looks
Code:
#!/bin/nash

# Load the modules
echo "Loading ieee1394 module"
insmod /lib/ieee1394.o
echo "Loading ohci1394 module"
insmod /lib/ohci1394.o
echo "Loading sbp2 module"
insmod /lib/sbp2.o
echo "Loading sd_mod module"
insmod /lib/sd_mod.o

# Mount proc filesystem
mount -t proc /proc /proc
echo Mounting /proc filesystem

# Now the fun part
echo "Making sure /dev/sda is present"
echo "Sleep for 3 seconds to make sure modules have initialized"
sleep 3
echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi
echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi
echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi
echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi

echo Creating root device
mkrootdev /dev/root
echo 0x0100 > /proc/sys/kernel/real-root-dev
echo Mounting root filesystem
mount --ro -t ext3 /dev/root /sysroot
umount /proc
pivot_root /sysroot /sysroot/initrd


yaboot.conf stuff
Relevant (and annotated) parts of my yaboot.conf are:
Code:
##My bootstrap partition
boot=/dev/sda6
## device is tricky part. You have to get this path from the OF promt
## you can also try to get it from /proc/device-tree if it exists.
## in my case fw is a predefined device alias. I think it should also be true for
##the powerbook. You can also try
##device=fw/node/sbp-2/disk@0:
device=fw/node@00d04b2a1008b38c/sbp-2@c000/disk@0:
partition=8
image=/boot/vmlinux-2.4.21-ben2
        label=Linux-New
        root=/dev/sda8
        read-only
        initrd=/boot/initrd-2.4.21-ben2.img.gz


Hope this helps. Please let me know how it works out. Cheers.
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Sun Jan 04, 2004 6:11 pm    Post subject: Reply with quote

fw146:

I'm trying to do the same, and am at the point of setting up yaboot.conf but am having a hard time trying to figure out the opefirmware path to my firewire drive....

Have any ideas?

-j
Back to top
View user's profile Send private message
fw146
n00b
n00b


Joined: 29 Dec 2003
Posts: 42

PostPosted: Mon Jan 05, 2004 3:12 pm    Post subject: Reply with quote

mindtripicus wrote:
fw146:

I'm trying to do the same, and am at the point of setting up yaboot.conf but am having a hard time trying to figure out the opefirmware path to my firewire drive....

Have any ideas?

-j

I am writing this assuming you don't know how to get to the OF prompt.

Try the following:
With the ibook/powerbook off, connect you fw-disk and power it up. Power-up your book while holding down <option>-<cmd>-O-F keys. This should bring you to the Open Firmware prompt. At the OF prompt type:
Code:
dev /
ls
This lists all the devices recognozed by the OF. Look for
Code:
nnnnnnnn:    /pci@f4000000
nnnnnnnn:       /firewire@e
nnnnnnnn:          /node@nnnnnnnnnnn.....
nnnnnnnn:             /sbp-2@nnnn
nnnnnnnn:                /disk@0

This (i.e. /pci@nnnnnnn/firewire.......) is the OF path to your disk.

If you cannot power-on the fw-disk before you power-on the book, or if you don't find an sbp-2 entry in the device listing, try
Code:
devalias
. This lists the pre-defined device aliases for your book. Note that all of them may not be valid aliases. Look for fw and fw1 in that order. Then do
Code:
dev fw
probe
ls

If this is the correct device, probe will detect your fw-disk and ls should output
Code:
nnnnnnnn:   /node@nnnnn.........
nnnnnnnn:       /sbp-2@nnnn
nnnnnnnn:           /disk@0

The correct path is thus fw/node@nnnn........./sbp-2@nnnn/disk@0.
If you still have not found your fw-disk. repeat this for other aliases with firewire in their expansions. Let me know how it works out.
Cheers!
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Mon Jan 05, 2004 11:35 pm    Post subject: Reply with quote

fw146

Thanks for running through all that, but I ended up figuring out how to do it by digging through /proc/device-tree

I'm now working on getting it to boot now. I compiled all the firewire stuff into the kernel to see if I could do it that way. I'm currently attempting to setup all the initrd stuff....hopefully I'll get it up and running soon...

Thanks again for the help...

-j
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Tue Jan 06, 2004 3:02 am    Post subject: Reply with quote

fw146

no matter what I do, it seems as though I can never get the root file system to mount on boot....

I tried it with all the firewire stuff compiled in the kernel, as well as all done as modules. I pretty much have done what you've outlined, but it always fails trying to mount the root partition...it says that it can't mount /dev/sda4 (which is my root partition)....

I'm pretty much tapped out of ideas at this point....

-j
Back to top
View user's profile Send private message
fw146
n00b
n00b


Joined: 29 Dec 2003
Posts: 42

PostPosted: Tue Jan 06, 2004 4:27 pm    Post subject: Reply with quote

mindtripicus wrote:
fw146

no matter what I do, it seems as though I can never get the root file system to mount on boot....

I tried it with all the firewire stuff compiled in the kernel, as well as all done as modules. I pretty much have done what you've outlined, but it always fails trying to mount the root partition...it says that it can't mount /dev/sda4 (which is my root partition)....

I'm pretty much tapped out of ideas at this point....

-j


My mistake! When you made the initrd, did you make sure that /dev/sda, /dev/sda1 and so on exist on the initrd? Remember that devfsd is not running at this point!
You might want to add a line
Code:
/bin/nash
right after you do
Code:
echo "scsi ...."
Then you have a shell and you can poke around to see if the fw subsystems recognized the drive properly and that
Code:
cat /proc/scsi/scsi
shows the drive as attached.

Most probably you are just missing /dev/sda etcetera, and making them with mknod should fix the problem.
Cheers
Back to top
View user's profile Send private message
DiskBreaker
Apprentice
Apprentice


Joined: 07 Oct 2003
Posts: 224

PostPosted: Tue Jan 06, 2004 10:19 pm    Post subject: Reply with quote

Not sure if this is of any help to you, but if you want the scsi system to rescan at boot, patch your kernel with this patch and uncomment the line
Code:
#define SBP2_USE_SCSI_ADDREM_HACK
in /usr/src/linux/drivers/ieee1394/sbp2.c.
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Wed Jan 07, 2004 5:23 am    Post subject: Reply with quote

fw146,

Hello again, it keeps on getting closer and closer...

Finally the linuxrc is actually running so now when I do the

echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi

it actually echos the line and does nothing else....leaving nothing in /proc/scsi/scsi

Any ideas?

-j
Back to top
View user's profile Send private message
fw146
n00b
n00b


Joined: 29 Dec 2003
Posts: 42

PostPosted: Wed Jan 07, 2004 2:43 pm    Post subject: Reply with quote

mindtripicus wrote:
fw146,

Hello again, it keeps on getting closer and closer...

Finally the linuxrc is actually running so now when I do the

echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi

it actually echos the line and does nothing else....leaving nothing in /proc/scsi/scsi

Any ideas?

-j

Hello mindtripicus,

I will need some more info. Did you compile ieee1394.o, ohci1304.o sbp2.o and sd_mod.o as modules? Or did you built them into the kernel. I suggest you build them as modules, execute
Code:
/bin/nash
as the first command in linuxrc and go through the steps manually. That way you can insmod and rmmod the modules and verify they recognize the drive properly. FYI after a successful attemp you should see something like
Code:
ieee1394: sbp2: Logged into SBP-2 device
ieee1394: sbp2: Node[00:1023]    GUID[nnnnnn.....]  [Oxford Semi.....]
ieee1394:  NodeMgr: hotplug policy ....
ieee1394:  Device added .....
ieee1394:  Host added: .......


Do you have support for any other scsi cards compiled into the kernel? If yes then you might have to try
Code:
echo "scsi add-single-device 1 0 0 0 >/proc/scsi/scsi"
echo "scsi add-single-device 2 0 0 0 >/proc/scsi/scsi"
and so on, till you can see your drive in /proc/scsi/scsi
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Wed Jan 07, 2004 3:09 pm    Post subject: Reply with quote

Ok,

ieee1394, ohci, sbp2, and sd_mod are all compiled as modules.

For some reason, if my script is a #!/bin/nash it does not execute. If it is a /bin/sh script it does...I suspect it is due to nash not existing within my initrd image.

What I did was write the linuxrc as a /bin/sh script instead. When it runs, I can actually see the modules loading up correctly, and see sbp2 logged into the firewire device.

I have set it up to open a shell (/bin/sh) and tried to execute the echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi and it does the same thing....only echos to the console but doesn't actually put the device in. I'm pretty sure that my firewire drive is 0 0 0 0 because when I'm booted off the liveCD, that loads my drive in correctly.

I don't think I have any other scsi cards compiled into the kernel....

-jamie
Back to top
View user's profile Send private message
fw146
n00b
n00b


Joined: 29 Dec 2003
Posts: 42

PostPosted: Wed Jan 07, 2004 6:18 pm    Post subject: Reply with quote

mindtripicus wrote:
Ok,


I have set it up to open a shell (/bin/sh) and tried to execute the echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi and it does the same thing....only echos to the console but doesn't actually put the device in. I'm pretty sure that my firewire drive is 0 0 0 0 because when I'm booted off the liveCD, that loads my drive in correctly.

I don't think I have any other scsi cards compiled into the kernel....

-jamie

Dear jamie,

As the kernel on the livecd and the one you are booting are different, your firewire drive maynot show up on the same SCSI address (i.e. 0 0 0 0). Try to execute the rescan-scsi-bus script linked by g-rem above. You will have to copy it to your initrd image. Chroot to your initrd image after you copy it and run it to make sure it runs. You might have to change #!/bin/bash to #!/bin/sh as the first line.

If you can, please post the messages you receive after each insmod.

The echo is because scsi subsytem did not find any device at 0 0 0 0 (host bus target lun). Another thing to look for is
Code:
scsi0 : SCSI emulation for IEEE-1394 SBP-2 Devices

This says my firewire host id is 0. If it says scsi1 for you then your drive should be at 1 0 0 0. In anycase give the rescan-scsi-bus.sh script a try.
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Wed Jan 07, 2004 11:04 pm    Post subject: Reply with quote

fw146,

well, I must say I feel a little embarrassed now....you're right. It was loading in as scsi1. I don't feel that bad in the end though, considering I'm pretty much a linux noob....

I'm considering writing up a how-to for the next person who might want to come along and do this.

Thanks so much for all your help....I definitely couldn't have pulled it off without it.

Cheers,
-jamie
Back to top
View user's profile Send private message
fw146
n00b
n00b


Joined: 29 Dec 2003
Posts: 42

PostPosted: Thu Jan 08, 2004 2:43 pm    Post subject: Reply with quote

mindtripicus wrote:
fw146,

well, I must say I feel a little embarrassed now....you're right. It was loading in as scsi1. I don't feel that bad in the end though, considering I'm pretty much a linux noob....
We have all been there :)!
mindtripicus wrote:

I'm considering writing up a how-to for the next person who might want to come along and do this.
Would be great.

Just to summarize: Contrary to previous belief, you can have a bootable (with yaboot) gentoo ppc system (or any other linux distribution) on an external firewire drive, without any modifications to the internal drive. You agree?

Cheers.
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Thu Jan 08, 2004 3:27 pm    Post subject: Reply with quote

fw146 wrote:


Just to summarize: Contrary to previous belief, you can have a bootable (with yaboot) gentoo ppc system (or any other linux distribution) on an external firewire drive, without any modifications to the internal drive. You agree?



I agree 100%. My internal hdd has not been touched.

On a side note, is there any way to boot into linux without having to tell it where yaboot is at the OF prompt?

Cheers,
-j
Back to top
View user's profile Send private message
woeye
n00b
n00b


Joined: 11 Feb 2003
Posts: 10
Location: Munich, Germany

PostPosted: Fri Jan 09, 2004 9:40 pm    Post subject: Will try this as well :-) Reply with quote

Thanks to the instructions above I will try to install Gentoo on my external FireWire disk as well. Fortunately it is weekend :lol:
Back to top
View user's profile Send private message
ukq7
n00b
n00b


Joined: 27 Mar 2003
Posts: 23
Location: Yurop

PostPosted: Sun Mar 07, 2004 10:17 am    Post subject: Reply with quote

mindtripicus wrote:

I'm considering writing up a how-to for the next person who might want to come along and do this.


Still considering? :)
Back to top
View user's profile Send private message
mindtripicus
n00b
n00b


Joined: 04 Jan 2004
Posts: 12

PostPosted: Thu Mar 11, 2004 2:00 am    Post subject: Reply with quote

ukq7 wrote:
mindtripicus wrote:

I'm considering writing up a how-to for the next person who might want to come along and do this.


Still considering? :)


Actually I still am. To be honest, I haven't even touched gentoo since I found out that I couldn't get 3D accel working on my 12" powerbook. I was hoping to get MOL working, but at the time it wouldn't run. Rumor has it that the new version does....but I digress.

Is there any interest in anybody having this written up?
Back to top
View user's profile Send private message
Patchoulol
n00b
n00b


Joined: 12 Mar 2004
Posts: 17

PostPosted: Fri Mar 12, 2004 12:04 pm    Post subject: Reply with quote

Does the new kernel (2.6) that comes with the 2004.0 supports FireWire drives? Or do I still need to do the actions described at the beginning of the topic?
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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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