Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 22 Aug 2014, 21:34
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to do a full install on external USB hdd
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [30 Posts]   Goto page: Previous 1, 2
Author Message
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Wed 12 Nov 2008, 08:52    Post subject:  

Béèm wrote:
Thanks to the reference to PizzasGood post about unpacking/repacking initrd I could go on further.

The boot process of the USB drive did start now, but got a message from EXTLINUX: could not find kernel image Linux
boot:

So I then entered /boot/vmlinuz and boot continued to end at a kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(22,1)

Still something missing on that USB drive?
I searched with puppysearch and only some ten hits were found with similar error messages.
One of the tips was to verify if the usbflash drive was set as boot: It was.

The usbflash drive is the only one I boot from, I disabled boot from the HDD0

Now I am unsure how to consider this flash drive now. As (hd0,0) or as (hd1,0)

As the first message (couldn't find a linux kernel) came from extlinux, I am not at the stage of grub yet?

UPDATE
I tried (hd1,0) but to no avail. Same thing.

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Wed 12 Nov 2008, 10:50    Post subject:  

Béèm,

I assume that your internal hdd is identified as /dev/sda and your usb device as /dev/sdb
I assume that you formatted one (ext2 or ext3) partition on your usb device, /dev/sdb1, and you full-installed to there
I assume that grub is correctly installed onto the MBR of your usb flash (also see my grub.readme below).
I assume that your BIOS is set to boot from usb.
I make no assumptions about partition boot flag, because grub doesn't care about it at all.

If different, please post.

Then you need:

(1) on the full-install usb partition:
- all regular full-install directories
- a directory /mnt/sdb1/boot
- inside that boot directory: original 'vmlinuz' (4.1-k2.6.25.16)
- inside that boot directory: the special full-boot 'initrd.gz'
- inside that boot directory: file 'marker'
- inside that boot directory: a subdirectory grub with the necessary grub files (at least 'stage_1', 'e2fs_stage1_5', 'stage_2', and of course also 'menu.lst')

(2) an entry in your grub 'menu.lst':
Code:
title Puppy 4.1-full on usb
root (hd0,0)
kernel /boot/vmlinuz root=/dev/sdb1 pdev1=sdb1 pmedia=usbflash nosmp
initrd /boot/initrd.gz

Note that root is indeed (hd0,0) when you boot off the usb first partition.
Note that the pdev1 boot hint *must* be specified, otherwise my init script defaults to hard-coded sdb9.

BTW - I have no idea what 'extlinux' is doing on your install, I don't have that. Hereunder I post my grub.readme help file that I always keep handy. It describes the procedure for installing and activating grub into the boot device's MBR. There's no 'catch-22' because, for running this installation procedure, you can perfectly start another grub instance e.g. from live-CD.
Quote:
File '/mnt/sdax/boot/grub.readme' edited by erikson 2008-Sep-24

Before and after the following procedure, backup MBR by using command (with appropriate device id): 'dd if=/dev/sda of=/path/mbrsave bs=512 count=1' or (preferrably) by running script '/mnt/sda2/MySeagate/%seagatecfgdump'.

Procedure:
1) Set/verify boot flag by running GParted or by typing console command: 'fdisk -l'. Actually grub doesn't care about boot flag; set it on the target grub boot partition "pro forma".
2) Start grub from console.
3) At the 'grub>' prompt, type command: 'find /boot/marker'. GRUB lists all drive(s) and partition(s) where it finds a marker file. Check that the target grub boot partition is listed.
4) While still at the grub prompt, type the three commands below. Be careful *not* to use hd0 by accident; this would put grub on the MBR of the internal hard drive and, for a Windows-formatted drive, would erase the Windows bootloader.
> root (hdx,y) (where hdx,y is a drive/partition reported in step 3)
> setup (hdx) (there should be some messages indicating success)
> quit
5) Edit file '/mntpnt/boot/grub/menu.lst' to match your particular setup.
6) Reboot, enter BIOS setup and change PC boot sequence as necessary.

Note that (hdx,y) for this installation procedure has nothing to do with the root or rootnoverify (hdx,y) settings in menu.lst (i.e. can be different). The former depends on where you boot from for installation and the latter depends on where you boot from for actually running the target.

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm

Back to top
View user's profile Send private message Visit poster's website 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Wed 12 Nov 2008, 15:43    Post subject:  

erikson wrote:
Béèm,

I assume that your internal hdd is identified as /dev/sda and your usb device as /dev/sdb
I assume that you formatted one (ext2 or ext3) partition on your usb device, /dev/sdb1, and you full-installed to there
I assume that grub is correctly installed onto the MBR of your usb flash (also see my grub.readme below).
I assume that your BIOS is set to boot from usb.
I make no assumptions about partition boot flag, because grub doesn't care about it at all.

If different, please post.
All this is correct.

ericson wrote:
Then you need:

(1) on the full-install usb partition:
- all regular full-install directories
- a directory /mnt/sdb1/boot
- inside that boot directory: original 'vmlinuz' (4.1-k2.6.25.16)
- inside that boot directory: the special full-boot 'initrd.gz'
- inside that boot directory: file 'marker'
- inside that boot directory: a subdirectory grub with the necessary grub files (at least 'stage_1', 'e2fs_stage1_5', 'stage_2', and of course also 'menu.lst')
You instructed to call the initrd.gz initrd-410k25-full-usb.gz as far as I understood the instruction. So that's what I have in /boot. The menu.lst reflect that name as well.
I don't have that file 'marker'. The modified installer didn't generate it.
The rest in /boot/grub is as you described.

ericson wrote:
(2) an entry in your grub 'menu.lst':
Code:
title Puppy 4.1-full on usb
root (hd0,0)
kernel /boot/vmlinuz root=/dev/sdb1 pdev1=sdb1 pmedia=usbflash nosmp
initrd /boot/initrd.gz

Note that root is indeed (hd0,0) when you boot off the usb first partition.
Note that the pdev1 boot hint *must* be specified, otherwise my init script defaults to hard-coded sdb9.
I did that.

ericson wrote:
BTW - I have no idea what 'extlinux' is doing on your install, I don't have that. Hereunder I post my grub.readme help file that I always keep handy. It describes the procedure for installing and activating grub into the boot device's MBR. There's no 'catch-22' because, for running this installation procedure, you can perfectly start another grub instance e.g. from live-CD.
In the root of the usbflash I had a file extlinux.sys. I thought it came from the modified installer. I had to go to another Wink PC to get rid of it.
But I still have the message
Code:
EXTLINUX 3.63 2008-04-10 EBIOS Copyright (C) 1004-2008 H. Peter Anvin
as first line.
Followed by: Could not find kernel image: linux.
If this doesn't come from the modified install, maybe it's from my PC's bios as I configured to allow boot from USB. I don't know.
ericson wrote:

Quote:
File '/mnt/sdax/boot/grub.readme' edited by erikson 2008-Sep-24

Before and after the following procedure, backup MBR by using command (with appropriate device id): 'dd if=/dev/sda of=/path/mbrsave bs=512 count=1' or (preferrably) by running script '/mnt/sda2/MySeagate/%seagatecfgdump'.

Procedure:
1) Set/verify boot flag by running GParted or by typing console command: 'fdisk -l'. Actually grub doesn't care about boot flag; set it on the target grub boot partition "pro forma".
2) Start grub from console.
3) At the 'grub>' prompt, type command: 'find /boot/marker'. GRUB lists all drive(s) and partition(s) where it finds a marker file. Check that the target grub boot partition is listed.
4) While still at the grub prompt, type the three commands below. Be careful *not* to use hd0 by accident; this would put grub on the MBR of the internal hard drive and, for a Windows-formatted drive, would erase the Windows bootloader.
> root (hdx,y) (where hdx,y is a drive/partition reported in step 3)
> setup (hdx) (there should be some messages indicating success)
> quit
5) Edit file '/mntpnt/boot/grub/menu.lst' to match your particular setup.
6) Reboot, enter BIOS setup and change PC boot sequence as necessary.

Note that (hdx,y) for this installation procedure has nothing to do with the root or rootnoverify (hdx,y) settings in menu.lst (i.e. can be different). The former depends on where you boot from for installation and the latter depends on where you boot from for actually running the target.
After executing step 3 I have no marker found, nor at the target usbflash partition nor at the hdd0 partition. The latter seems normal to me as I use Lin'N'win on this windows partition
I am unsure if I have to enter the other commands referenced.
Should I (re)-install grub on the target device?
(nevertheless an interesting exercise)

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Wed 12 Nov 2008, 19:19    Post subject:  

The weakest point in the chain very often is the human error. Embarassed
When installing grub I took the default, which I thought was the usbflash, but in reality it was the hdd0, so that explains why I had a corrupted MR and couldn't boot from hdd0.

That doesn't explain the extlinux thing.

Anyway I erased the partition and started over again.
This time taken care I installed grub to sdb1.
And yes when booting I got now the grub menu of sdb1.

Remade the special initrd.gz and adapted the menu.lst.
I still didn't had that marker file, but in the package pup2usb I found such a file and put it in /boot.

So crossing fingers I booted from the usbflash and selected the puppy on sdb1
I got an error File system type unknown, partition type 0x7

Error 17: Cannot mount selected partition.

Getting closer, but still something wrong.

UPDATE
Hadn't changed the generated (hd1,0) to (hd0,0)

Now it's working.
In fact this was a preparation to do such an install on an external connected USB HDD.
I tried usbflash, so no much harm could be done.

Now I have to see how this setup fits into the Lin'N'Win setup I already have on this PC.
As the usbflash device is the first in the HDD boot chain, just have it pulled out when booting, will boot from the hdd0, I suppose.

A big thanks to Erikson for finding this method.

The Morning after

Altho I did pay attention this time, I got the dreaded grub error 21 again when trying to boot from hdd0. Did the fdisk /mbr and all's well.
I tested then if I still could boot from the usbflash and it did.
So I conclude there is a flaw in the install grub script.
Altho selecting /dev/sdb to write grub too (MBR) the MBR of sda is affected as well.
I have no idea why.

Funny thing when using the usbflash. This device is represented as a floppy on the desktop.

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Fri 14 Nov 2008, 10:44    Post subject:  

So you succeeded... congrats!
(And you did check pupstate, I presume)

Béèm wrote:
Anyway I erased the partition and started over again. This time taken care I installed grub to sdb1.

Okay. My modified installer script installs full-Puppy, but not grub, you have to do that yourself. I didn't mention that... somehow took it for granted.

Quote:
I still didn't had that marker file, but in the package pup2usb I found such a file and put it in /boot.

Okay. Actually any file named 'marker' will do, even an empty one. You could create one using touch /mnt/sdb1/boot/marker

Quote:
Hadn't changed the generated (hd1,0) to (hd0,0). Now it's working.

Very important, that's why I explicitly mentioned that install-time (hdx,y) and boot-time (hdx,y) can be different.

Quote:
Now I have to see how this setup fits into the Lin'N'Win setup I already have on this PC. As the usbflash device is the first in the HDD boot chain, just have it pulled out when booting, will boot from the hdd0, I suppose.

Yes. But it may be more elegant to leave the usbflash in place and adapt the BIOS boot sequence for booting off hdd.

I assume that lin-n-win has menu-choice capabilities similar to grub; then an entry in your hdd bootloader menu can still refer to Puppy on usb. This time with (hd1,0) because, when starting the boot process off hdd, hdd will be hd0 and usbflash will be hd1. Normally that's the only thing in the Puppy menu entry that's different.

And you can simply switch from hdd-bootlader to usb-bootloader and inversely (both menus allowing to boot Puppy from usb or Win from hdd or whatever else), just by changing the BIOS boot sequence.

Quote:
So I conclude there is a flaw in the install grub script. Altho selecting /dev/sdb to write grub too (MBR) the MBR of sda is affected as well. I have no idea why.

That's strange. I have experienced no problems with grub install once I had it under my belt.

Quote:
Funny thing when using the usbflash. This device is represented as a floppy on the desktop.

Yes, for me too.

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm

Back to top
View user's profile Send private message Visit poster's website 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Fri 14 Nov 2008, 15:22    Post subject:  

Additional note ---

Barry found a bug in 2.6.25.16 that may affect usb booting, cfr Barry's blog

I didn't notice the bug during my tests, because my usb devices only use the ehci-hcd and uhci-hcd driver modules (not the affected ohci-hcd module). You can verify which driver(s) your usb device(s) use by running lsmod | grep "hci" on a 2.6.21.7 Puppy version that can access your devices.

As an alternative to Barry's patch (see his blog), also my technique can be used to patch initrd.gz

After unpacking initrd.gz and before repacking it:

(1) mount the relevant pup_xxx.sfs file and locate the driver module
/lib/modules/2.6.25.16/kernel/drivers/ssb/ssb.ko

(2) gzip it to
/lib/modules/2.6.25.16/kernel/drivers/ssb/ssb.ko.gz
and copy it into the expanded initrd-tree

(3) in the expanded initrd-tree, edit the additional dependency into
/lib/modules/2.6.25.6/modules.dep
i.e. locate and replace the line
Code:
/lib/modules/2.6.25.16/kernel/drivers/usb/host/ehci-hcd.ko.gz:
/lib/modules/2.6.25.16/kernel/drivers/usb/core/usbcore.ko.gz

with the line
Code:
/lib/modules/2.6.25.16/kernel/drivers/usb/host/ehci-hcd.ko.gz:
/lib/modules/2.6.25.16/kernel/drivers/usb/core/usbcore.ko.gz
/lib/modules/2.6.25.16/kernel/drivers/ssb/ssb.ko

(Note: must be on one line with the three fields separated by a space)

Sorry I can't test it (I have no affected usb device) but I think it should work.

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm


Last edited by erikson on Fri 14 Nov 2008, 15:53; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Fri 14 Nov 2008, 15:46    Post subject:  

Thank you erikson for the update.
As I wasn't asked to save a pup_save, I assumed I was in full
And indeed this is in pupstate
Code:
PUPMODE=2
ATADRIVES='sda sdb '
PUP_HOME='/'

About the boot, I don' worry too much. It's easy to go into the bios.
Once I do setup that USB HDD, thinks get complicated anyway as I will have also that USB flash to boot from eventually and I will have to choose in the bios for the booting anyway then.

I indeed wondered what the impact of Barry's comment was about USB
Thank you for replying before I did ask? Wink

Anyway it's a great procedure, altho it didn't work for the desktop.
The USB flash is first in line to boot from, but isn't considered.
I will have to investigate further.

As for booting from within Lin'N'Win i'll have to investigate also.
I have no clear view for the moment how to achieve this.

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Fri 14 Nov 2008, 16:05    Post subject:  

Béèm wrote:
I indeed wondered what the impact of Barry's comment was about USB. Thank you for replying before I did ask? Wink

I dropped a note on Barry's blog. I wonder if there will be interest to merge full-booting off usb into regular Puppy releases.

Quote:
Anyway it's a great procedure, altho it didn't work for the desktop.
The USB flash is first in line to boot from, but isn't considered. I will have to investigate further.

Keep us posted. Are you sure your desktop is capable of booting off usb? It's also possible that my waiting loop for usb registration (see init script) ends too fast; you may try and add a "sleep 3" immediately after the loop, and see what gives. You may also try and clone my initrd technique for the retro kernel, this avoids the potential ohci bug problem.

Quote:
As for booting from within Lin'N'Win i'll have to investigate also.
I have no clear view for the moment how to achieve this.

Can't help on this one since I'm not familiar with Lin'N'Win. Good luck.

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm

Back to top
View user's profile Send private message Visit poster's website 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Fri 14 Nov 2008, 16:36    Post subject:  

Yes the bios recognizes the USB flash device and identifies it correctly (the same way as the laptop does)
But it has dual 1,8Ghz processors and maybe the sleep command can be useful.

For the booting from within Lin'N'Win I'll see with ICPUG.

I am working right now on the USB flash, but indeed this is only to be for test purposes.
It's amazing how many accesses are performed to the device.

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
gschl

Joined: 10 Jan 2007
Posts: 14

PostPosted: Tue 02 Dec 2008, 15:03    Post subject:  

just a brief note that, using the information and script provided by erikson, I could install Puppy 411 to and boot from a partition of my usb-harddrive (Trekstor) - thank you!!
Back to top
View user's profile Send private message 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Tue 02 Dec 2008, 16:52    Post subject:  

gschl wrote:
just a brief note that, using the information and script provided by erikson, I could install Puppy 411 to and boot from a partition of my usb-harddrive (Trekstor) - thank you!!

So, that makes at least three of us (you, Béèm and myself)... Wink

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm

Back to top
View user's profile Send private message Visit poster's website 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Tue 02 Dec 2008, 19:48    Post subject:  

So one more and we can play cards. Wink
_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
gschl

Joined: 10 Jan 2007
Posts: 14

PostPosted: Wed 03 Dec 2008, 03:00    Post subject:  

actually, when looking at a new distro, usually first thing is to check installing to usb-harddisk, since there is virtually unlimited space to play.
To my knowledge nowadays all major linux versions have this feature implemented OOTB, but I still remember that in the early days of knoppix you also had to play with initrd.
With Puppy I was late to test this feature since the frugal thing is such an easy solution......
Back to top
View user's profile Send private message 
Q5sys


Joined: 11 Dec 2008
Posts: 1047

PostPosted: Thu 11 Dec 2008, 15:52    Post subject: Would this work?  

Not to sound like a complete Noob here, but couldnt you just install to a HD, then image the drive and 'burn' that image onto a USB drive?
I've done this with other Linux Installs and it works. Is there any reason why it wouldnt work for Puppy?
Back to top
View user's profile Send private message 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Fri 12 Dec 2008, 04:57    Post subject: Re: Would this work?  

Q5sys wrote:
Not to sound like a complete Noob here, but couldnt you just install to a HD, then image the drive and 'burn' that image onto a USB drive?
I've done this with other Linux Installs and it works. Is there any reason why it wouldnt work for Puppy?

Try it and report Wink

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 2 of 2 [30 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1520s ][ Queries: 12 (0.0281s) ][ GZIP on ]