Tahrpup Can't find Save folder on Large USB Hard Drive

Using applications, configuring, problems
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Tahrpup Can't find Save folder on Large USB Hard Drive

#1 Post by s243a »

This relates a bit to my other thread: boot parmaters, case wrong on wiki?

I'm trying to boot from a large flash drive on sdd4 that puppy can't find.

I've added some extra boot paramaters to try to help puppy out:

Code: Select all

title Puppy tahr 6.0.6 (find sdd4)
  uuid fab3b011-746f-448b-85a3-5f7fb7f8e7f6
  find --set-root uuid () fab3b011-746f-448b-85a3-5f7fb7f8e7f6
  kernel /vmlinuz  pmedia=usbhd psubdir=/ pfix=fsck pdrv=fab3b011-746f-448b-85a3-5f7fb7f8e7f6 psave=fab3b011-746f-448b-85a3-5f7fb7f8e7f6:tahrsave
  initrd /initrd.gz
I'm sure that some of the things above are redundant.

I also tried

Code: Select all

pdrive=() 
because in grub4dos "()" is supposed to refer to the drive that one is booting off (sdd4 in my case).

Here are some log files:
/mnt/sdd2/zz_initrd_tmp

Code: Select all

0: PMEDIA=usbhd PDRV=fab3b011-746f-448b-85a3-5f7fb7f8e7f6 PSUBDIR=/ pfix=fsck
1: PDRV= P_BP_ID=fab3b011-746f-448b-85a3-5f7fb7f8e7f6 P_BP_FN=
cat: can't open '/sys/block/pdr/queue/rotational': No such file or directory
mount: can't read '/etc/fstab': No such file or directory
cat: can't open '/sys/block/pdr/queue/rotational': No such file or directory
mount: can't read '/etc/fstab': No such file or directory
sdd4 on /mnt/pdrv as  mount failed.
2: ONE_PART=sdd4 ONE_FN= ONE_MP=
6: ONE_PART=sdd4 ONE_TRY_FN= PDRV=
/mnt/sdd2/dmesg.txt

Code: Select all

...
usb-storage 1-7.2:1.0: USB Mass Storage device detected
scsi6 : usb-storage 1-7.2:1.0
scsi 6:0:0:0: Direct-Access     WD       My Book 25EE     4004 PQ: 0 ANSI: 6
scsi 6:0:0:1: Enclosure         WD       SES Device       4004 PQ: 0 ANSI: 6
sd 6:0:0:0: [sdc] Spinning up disk...
scsi 4:0:0:0: Direct-Access     TOSHIBA  External USB 3.0 5438 PQ: 0 ANSI: 6
sd 4:0:0:0: [sdd] 3907029160 512-byte logical blocks: (2.00 TB/1.81 TiB)
sd 4:0:0:0: [sdd] Write Protect is off
sd 4:0:0:0: [sdd] Mode Sense: 23 00 00 00
sd 4:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
.
 sdd: sdd1 sdd2 sdd3 sdd4
...
/mnt/sdd2/probepart.log

Code: Select all

...
ONEDEV=sdd1 SIZE=4188160 DEVICE=sdd1
  SIZE=4188160 FSTYPE=vfat
  /dev/sdd1|vfat|8376320
ONEDEV=sdd2 SIZE=871282688 DEVICE=sdd2
  SIZE=871282688 FSTYPE=ext4
  /dev/sdd2|ext4|1742565376
ONEDEV=sdd3 SIZE=33552384 DEVICE=sdd3
  SIZE=33552384 FSTYPE=swap
  /dev/sdd3|swap|67104768
ONEDEV=sdd4 SIZE=1044490240 DEVICE=sdd4
  SIZE=1044490240 FSTYPE=ext2
  /dev/sdd4|ext2|2088980480
...
/mnt/sdd2/zz_initrd_tmp/sys.log

Code: Select all

...
Jan  8 00:25:09 puppy kern.notice kernel: sd 4:0:0:0: [sdd] 3907029160 512-byte logical blocks: (2.00 TB/1.81 TiB)
Jan  8 00:25:09 puppy kern.notice kernel: sd 4:0:0:0: [sdd] Write Protect is off
Jan  8 00:25:09 puppy kern.debug kernel: sd 4:0:0:0: [sdd] Mode Sense: 23 00 00 00
Jan  8 00:25:09 puppy kern.notice kernel: sd 4:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan  8 00:25:09 puppy kern.warn kernel: .
Jan  8 00:25:09 puppy kern.info kernel:  sdd: sdd1 sdd2 sdd3 sdd4
Jan  8 00:25:09 puppy kern.notice kernel: sd 4:0:0:0: [sdd] Attached SCSI disk
...

Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#2 Post by Sailor Enceladus »

So the puppy files are in the root of /mnt/sdd4, and the save folder is in /mnt/sdd4/tahrsave? And puppy boots but the save folder doesn't? Did you made the savefolder by shutting down puppy and selecting a drive from the list of selections? If so, as you say I think the addition of the psave=, psubdir=/ and pdrv would seem redundant. The zz_initrd_tmp output is interesting.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#3 Post by bigpup »

Looking at your menu entry.
The placement of the options is important.
Notice in my example menu entries where options are in the kernel line.
Some of yours do not even look like a working option.
The drive partition is already identified in the second line of the entry. (uuid fab3b011-746f-448b-85a3-5f7fb7f8e7f6)
You should not need any other option to make stuff look on that specific partition.

I have a 1 TB USB hard drive with a lot of Puppies installed on 7 different partitions.
The drive is identified by Puppy as sdc

I run Grub4dos config.
Select the USB hard drive as the device to install on.
Select search only within this device.
Say OK to all other selection screens.

So I end up with Grib4dos boot loader on the USB hard drive and a boot menu listing everything that is on the drive.

When I boot the computer, I have it boot from USB device. The USB hard drive.
The menu pops up and I select which Puppy to boot.

This works with no problem.

If I remove a Puppy version or install a Puppy version.
I rerun Grub4dos config to make a new boot menu.

Here is some of the menu entries:

Code: Select all

# menu.lst produced by grub4dosconfig-v1.9.2
splashimage=/lvxm5.xpm
foreground=00CD00
#background=F0F8FF

timeout 10
default 0

# Frugal installed Puppy

title Puppy xenialpup64 7.5 (sdc7/xenialpup6475uefi)
  uuid 1cd0f861-5576-42aa-af41-d09a6d260bc9
  kernel /xenialpup6475uefi/vmlinuz   psubdir=xenialpup6475uefi pmedia=atahd pfix=fsck 
  initrd /xenialpup6475uefi/initrd.gz

title Puppy slacko 6.9.9.9 (sdc2/slacko6999k3164GFFABI)
  uuid 1361-B01D
  kernel /slacko6999k3164GFFABI/vmlinuz   psubdir=slacko6999k3164GFFABI pmedia=atahd pfix=fsck
  initrd /slacko6999k3164GFFABI/initrd.gz

title Puppy xenialpup64 7.0.8.5 (sdc3/xenialpup647085uefi)
  uuid 24a14d90-6d75-4276-a6a0-ef026f8d07cf
  kernel /xenialpup647085uefi/vmlinuz   psubdir=xenialpup647085uefi pmedia=atahd pfix=fsck
  initrd /xenialpup647085uefi/initrd.gz

title Puppy xenialpup64 7.0.8.6 (sdc3/xenialpup647086)
  uuid 24a14d90-6d75-4276-a6a0-ef026f8d07cf
  kernel /xenialpup647086/vmlinuz   psubdir=xenialpup647086 pmedia=atahd pfix=fsck
  initrd /xenialpup647086/initrd.gz

title Puppy xenialpup 7.5 (sdc3/xenialpup75uefi)
  uuid 24a14d90-6d75-4276-a6a0-ef026f8d07cf
  kernel /xenialpup75uefi/vmlinuz   psubdir=xenialpup75uefi pmedia=atahd pfix=fsck
  initrd /xenialpup75uefi/initrd.gz

title Puppy slacko 6.9.9.9 (sdc5/slacko6999uefik44PAEPMLO)
  uuid 19b0847a-549d-49c9-8c98-25af56f1d0ee
  kernel /slacko6999uefik44PAEPMLO/vmlinuz   psubdir=slacko6999uefik44PAEPMLO pmedia=atahd pfix=fsck
  initrd /slacko6999uefik44PAEPMLO/initrd.gz

title Puppy zestypup 17.10.16 (sdc5/zestypup171016)
  uuid 19b0847a-549d-49c9-8c98-25af56f1d0ee
  kernel /zestypup171016/vmlinuz   psubdir=zestypup171016 pmedia=atahd pfix=fsck
  initrd /zestypup171016/initrd.gz
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#4 Post by s243a »

Strange thing. This time. I got the boot prompt. I poked around a bit and then typed

Code: Select all

 
reboot
Followed by enter.

and it worked. I'm not sure if it will work my next reboot though. I'm guessing that it is a timing issue. If another usb device is up and running when it checks

Code: Select all

 /initrd/tmp/flag-usb-ready
then puppy thinks that all USB devices are ready even if one of the USB devices that one specified in the boot paramaters isn't yet ready.

However, my hypothesis doesn't completely make sense because I'm booting from the device so it is in a sense ready but not ready in some way when puppy checks this flag. Maybe the ram-disk hasn't mounted it yet.

Anyway, here is some new log data:
/initrd/tmp/bootinit.log

Code: Select all

0: PMEDIA=usbhd PDRV=fab3b011-746f-448b-85a3-5f7fb7f8e7f6 PSUBDIR=/ pfix=fsck
1: PDRV= P_BP_ID=fab3b011-746f-448b-85a3-5f7fb7f8e7f6 P_BP_FN=
2: ONE_PART=sdd4 ONE_FN=//puppy_tahr_6.0.6.sfs ONE_MP=/mnt/pdrv
6: ONE_PART=sdd4 ONE_TRY_FN=//puppy_tahr_6.0.6.sfs PDRV=sdd4,ext2,//puppy_tahr_6.0.6.sfs
mount -o remount,append:/pup_ro2=rr /pup_new
mount -o remount,append:/pup_z=rr /pup_new
--------------------
SAVE_MP=/mnt/dev_save
PRAMONLY=
BOOTDRV=sdd
rootfs on / type rootfs (rw,size=1535464k,nr_inodes=217426)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=1535480k,nr_inodes=217434,mode=755)
/dev/sdd4 on /mnt/dev_save type ext2 (rw,relatime,errors=continue,user_xattr)
tmpfs on /mnt/tmpfs type tmpfs (rw,relatime)
unionfs on /pup_new type aufs (rw,relatime,si=202bbf34)
/dev/loop0 on /pup_ro2 type squashfs (ro,noatime)
/dev/loop1 on /pup_z type squashfs (ro,noatime)
--------------------
FND_MULTIFOLDER=
PUPSAVE=sdd4,ext2,//tahrsave
Setting PUPMODE 12
SAVE_LAYER=/pup_rw
--SAVEFOLDER-- /mnt/dev_save//tahrsave
'/pup_rw' -> '/mnt/dev_save//tahrsave'
mount -o remount,prepend:/pup_rw=rw,mod:/mnt/tmpfs/pup_rw=ro,del:/mnt/tmpfs/pup_rw /pup_new
SAVE_FN=/mnt/dev_save//tahrsave
SAVE_LAYER=/pup_rw
'/pup_new/initrd/pup_rw' -> '/initrd/mnt/dev_save//tahrsave'
--------------------
rootfs on / type rootfs (rw,size=1535464k,nr_inodes=217426)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=1535480k,nr_inodes=217434,mode=755)
/dev/sdd4 on /pup_new/initrd/mnt/dev_save type ext2 (rw,relatime,errors=continue,user_xattr)
tmpfs on /pup_new/initrd/mnt/tmpfs type tmpfs (rw,relatime)
unionfs on /pup_new type aufs (rw,relatime,si=202bbf34)
/dev/loop0 on /pup_new/initrd/pup_ro2 type squashfs (ro,noatime)
/dev/loop1 on /pup_new/initrd/pup_z type squashfs (ro,noatime)
--------------------
'/pup_new/tmp' -> '/initrd/mnt/tmpfs/tmp'

Maybe we need some boot parmater that tells puppy how long to ensure that all devices specified as boot parmaters are ready.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#5 Post by s243a »

For future discussion I"m going to post some code from
/initrd/init
in tahrpup

Lines 793 to 800

Code: Select all

wait_for_usb() {
 [ -e /tmp/flag-usb-ready ] && return
 echo -n "${L_WAITING_FOR_USB}" > /dev/console 
 /sbin/wait4usb
 get_part_info
 BLKIDOUT=""
 check_status 0
}
However, I don't see the function

Code: Select all

/sbin/wait4usb
in my file system. Maybe it's in initrd but oddly for some reason not in the /initrd folder or relative to my root file system.

Perhaps If I look inside the initrd.gz image. I'll see it. I see a suggestion on how to do this at:
To edit initrd.gz in linux you will have to:-


gunzip initrd.gz

If you have an .img extenstion:-

gunzip -S .img initrd-2.6.X.img

cpio -imdF initrd
https://www.linuxquestions.org/question ... ost2305513

Anyway, returning to /initird/init:wait_for_usb()

this function is called in a few places but not sure which spot reflect my boot process. The places are as follows:

Lines 927 to 936

Code: Select all

#establish PDRV
P_PART=""; LOOK_PUP=""; LOOK_SAVE=""
if [ "$P_BP_ID" ];then #specified as parameter
 decode_id "$P_BP_ID"
 [ "$ONE_PART" ] && { P_PART="$ONE_PART"; P_BP_ID=""; }
 if [ "$P_PART"  = "" ];then
  wait_for_usb
  decode_id "$P_BP_ID"
  [ "$ONE_PART" ] && { P_PART="$ONE_PART"; P_BP_ID=""; }
 fi
Lines 947 to 959

Code: Select all

if [ "$LOOK_PUP" -o "$LOOK_SAVE" ];then #something to search for
 [ "${PMEDIA:0:3}" != "usb" ] && search_func
 if [ "$P_PART" = "" ];then
  wait_for_usb
  USBDRVS="$(find /sys/block -maxdepth 1 -name 'sd*' -o -name 'sr*' | xargs -n 1 readlink 2>/dev/null | grep '/usb[0-9]' | rev | cut -f 1 -d '/' | rev | tr '\n' '|')"
  [ "$PDEBUG" ] && echo "2: USBDRVS=$USBDRVS -> ${USBDRVS%|}"
  if [ "$USBDRVS" ] ; then
    search_func "${USBDRVS%|}"
  else
    search_func
  fi
 fi
fi
Lines 967 to 972:

Code: Select all

#establish SAVEPART
decode_other_ids
if [ "$Z_BP_ID" -o "$F_BP_ID" -o "$A_BP_ID" -o "$Y_BP_ID" -o "$SAVE_BP_ID" ];then
 wait_for_usb
 decode_other_ids
fi
The boot parmater ID is set here. I included some other parmater settings for later reference:

Lines 897 to 903

Code: Select all

#100915 technosaurus recommendation (see above)...
[ "$PDRV" ] && { decode_spec "$PDRV"; P_BP_ID="$ONE_BP_ID"; P_BP_FN="$ONE_BP_FN"; PDRV=""; }
[ "$ZDRV" ] && { decode_spec "$ZDRV"; Z_BP_ID="$ONE_BP_ID"; Z_BP_FN="$ONE_BP_FN"; ZDRV=""; }
[ "$FDRV" ] && { decode_spec "$FDRV"; F_BP_ID="$ONE_BP_ID"; F_BP_FN="$ONE_BP_FN"; FDRV=""; }	
[ "$ADRV" ] && { decode_spec "$ADRV"; A_BP_ID="$ONE_BP_ID"; A_BP_FN="$ONE_BP_FN"; ADRV=""; }
[ "$YDRV" ] && { decode_spec "$YDRV"; Y_BP_ID="$ONE_BP_ID"; Y_BP_FN="$ONE_BP_FN"; YDRV=""; }
[ "$PSAVE" ] && { decode_spec "$PSAVE"; SAVE_BP_ID="$ONE_BP_ID"; SAVE_BP_FN="$ONE_BP_FN"; }
Lines 193 to 200

Code: Select all

decode_spec() {
 ONE_BP_ID=""; ONE_BP_FN=""
 [ "${1}" ] || return
 ONE_BP_ID="$(echo "$1" | cut -f 1 -d ':')"
 ONE_BP_FN="$(echo "$1" | cut -f 2 -d ':')"
 [ "$ONE_BP_FN" = "$ONE_BP_ID" ] && ONE_BP_FN=""
 [ "$ONE_BP_FN" ] && [ "${ONE_BP_FN:0:1}" != "/" ] && ONE_BP_FN="$PSUBDIR/$ONE_BP_FN"
}
Here is some related parameter processing:



Lines 213 to 225

Code: Select all

decode_other_ids() {
 #get ONE_PART from DEV or ID specified in sfs boot params
 decode_id "$Z_BP_ID"
 [ "$ONE_PART" ] && { Z_PART="$ONE_PART"; Z_BP_ID=""; }
 decode_id "$F_BP_ID"
 [ "$ONE_PART" ] && { F_PART="$ONE_PART"; F_BP_ID=""; }
 decode_id "$A_BP_ID"
 [ "$ONE_PART" ] && { A_PART="$ONE_PART"; A_BP_ID=""; }
 decode_id "$Y_BP_ID"
 [ "$ONE_PART" ] && { Y_PART="$ONE_PART"; Y_BP_ID=""; }
 decode_id "$SAVE_BP_ID"
 [ "$ONE_PART" ] && { SAVEPART="$ONE_PART"; PSAVEPART="$ONE_PART"; SAVE_BP_ID=""; }
}

Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#6 Post by Sailor Enceladus »

Sailor Enceladus wrote:So the puppy files are in the root of /mnt/sdd4, and the save folder is in /mnt/sdd4/tahrsave? And puppy boots but the save folder doesn't? Did you made the savefolder by shutting down puppy and selecting a drive from the list of selections?
Argh, first DavidSpectre and now s243a... ignoring questions completely... what is wrong with this planet :cry: rageragerage

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#7 Post by s243a »

Sailor Enceladus wrote:
Sailor Enceladus wrote:So the puppy files are in the root of /mnt/sdd4, and the save folder is in /mnt/sdd4/tahrsave? And puppy boots but the save folder doesn't? Did you made the savefolder by shutting down puppy and selecting a drive from the list of selections?
Argh, first DavidSpectre and now s243a... ignoring questions completely... what is wrong with this planet :cry: rageragerage
The answer is yes.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#8 Post by jafadmin »

Have you tried: "pmedia=usbflash"?

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#9 Post by bigpup »

Also try

Code: Select all

pmedia=atahd
Why?
Because the computers bios may be identifying it that way.

Have you tried to run Grub4dos config and let it make the menu entry?
Again, your menu entry example, in the first post, looks not correct.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#10 Post by s243a »

bigpup wrote:Also try

Code: Select all

pmedia=atahd
Why?
Because the computers bios may be identifying it that way.
Maybe but in dmesg it shows up as a USB device
Have you tried to run Grub4dos config and let it make the menu entry?
Yes and as mentioned above grub4dos gave me pmedia=atahd which didn't work. Changing this to usbhd was required because otherwise puppy won't wait long enough for the usb hard drive to mount.

Changing this did actually find a save file but not on the drive that I booted from.

Anyway using grub4 dos I get something like this:

Code: Select all

title Puppy tahr 6.0.6 (sdd4)
  uuid fab3b011-746f-448b-85a3-5f7fb7f8e7f6
  kernel /vmlinuz  pmedia=atahd pfix=fsck
  initrd /initrd.gz
but since it wasn't finding the save folder I added/changed some parmaters:

Code: Select all

pmedia=usbhd
psubdir=/ 
pfix=fsck 
pdrv=fab3b011-746f-448b-85a3-5f7fb7f8e7f6 
psave=fab3b011-746f-448b-85a3-5f7fb7f8e7f6:tahrsave
I probably also don't need to specify the uid for psave. The uid for pdrv seems necessary because the init script is not properly detecting which drive I booted from.

The find is redundant since the uuid is already specified but it doesn't hurt antying. I was just making double sure. I think that you have to use find if you are using lables on NTFS systems but otherwise you can simply use the uuid command.
Again, your menu entry example, in the first post, looks not correct.
I disagree. As evidence of that as mentioned above I have had one successful boot with this setup.I'm convinced this is because puppy isn't waiting long enough. I happen to have 3 large usb hard drive (greater than a terrabyte) plugged into and old computer with at best USB 2.0 ports.

A nice thing about this particular bios is that it lets me select which USB device to boot from. Unfortunately it won't let me install the bootloader on a linux partition so I have grub on sdd1 on fat14 and puppy installed to sdd4. I can see when I boot that both of these drives are mounted but unfortunately they are mounted too late for puppy to find the save folder.

Anyway, I tried imagineers7 suggestion for looking initrd.gz
gunzip initrd.gz

If you have an .img extenstion:-

gunzip -S .img initrd-2.6.X.img

cpio -imdF initrd
https://www.linuxquestions.org/question ... ost2305513

It seems to have extracted this image but I don't know exactly where. I found the file that I was looking for at:

Code: Select all

/mnt/home/sbin/wait4usb
https://pastebin.com/eGjgRuqX

anyway looking at this code, the script only waits for 3 seconds which seems to be usually not enough time for my setup

Code: Select all

#i want this to work with kernel that does not have my usb-storage patch, feedback is that 3 secs is enough...
while [ $CNTUSB -lt 3 ];do
 sleep 1
 CNTUSB=$(($CNTUSB+1))
 echo -en "\\033[1;33m.\\033[0;39m" >/dev/console #yellow dot
done
It would be pretty easy to add a boot paramater to give a longer delay but really there should be a second delay time that waits a bit longer to try to find pdrv (if specified).

Anyway, I could play around with this code for a bit. I don't really understand how cpio works nor do I know how to rebuild the image. I'll do some reading to see if I can figure it out.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#11 Post by s243a »

jafadmin wrote:Have you tried: "pmedia=usbflash"?
I'll try that later but it shouldn't really solve my issue. First I want to look at modifying /initrd/init and initrd.gz/sbin/wait4usb

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#12 Post by bigpup »

Where is the Grub4dos menu located?
sda
sdb
sdc
sdd

I happen to have 3 large usb hard drive (greater than a terrabyte) plugged into and old computer with at best USB 2.0 ports.
Just to see what happens.

Only have the USB hard drive that Tahrpup 6.0.6 is on plugged in.
No other USB drives.

This may make the drive look like sdb to Puppy.
(The partition would be sdb4.
I assume you have an internal hard drive identified as sda).

I think you could be dealing with which USB drive gets found first or the order in which they are found.

Are you sure all the USB ports are at minimum USB 2.0?
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#13 Post by s243a »

bigpup wrote:Where is the Grub4dos menu located?
sda
sdb
sdc
sdd
sdd1

I happen to have 3 large usb hard drive (greater than a terrabyte) plugged into and old computer with at best USB 2.0 ports.
Just to see what happens.

Only have the USB hard drive that Tahrpup 6.0.6 is on plugged in.
No other USB drives.

This may make the drive look like sdb to Puppy.
I'm pretty sure that this would work. I'm not looking for a hack though I want to fix this and as a bonus learn something about puppy.
I think you could be dealing with which USB drive gets found first or the order in which they are found.
It does something like that if I don't specify enough boot parmaters. I need at least one of these:

Code: Select all

pdrv=fab3b011-746f-448b-85a3-5f7fb7f8e7f6
psave=fab3b011-746f-448b-85a3-5f7fb7f8e7f6:tahrsave 
In order to force it to look on the correct partition. However, it's not always waiting long enough to find it.

Are you sure all the USB ports are at minimum USB 2.0?
I just assumed that because it is an old computer. I would think that if it was USB 3.0 then the drive would mount much faster and I won't be having these "too short of a delay issues.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#14 Post by bigpup »

You could have some USB 1.0 and some USB 2.0 ports on a old computer.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#15 Post by s243a »

bigpup wrote:You could have some USB 1.0 and some USB 2.0 ports on a old computer.
I suppose I should of said at best USB 2.0.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#16 Post by bigpup »

If the Grub4dos bootloader is on the same USB hard drive, sdd1 the first partition.

Tahrpup 6.0.6 is all installed on partition sdd4.
Everything including the save.
Nothing is in a directory, just on the partition.

Try this for a save parameter in the boot menu entry.

Code: Select all

psave=sdd4:/tahrsave
This assumes the save is a save folder.

Or using the uuid.

Code: Select all

psave=fab3b011-746f-448b-85a3-5f7fb7f8e7f6/sdd4:/tahrsave
Last edited by bigpup on Wed 10 Jan 2018, 07:09, edited 1 time in total.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#17 Post by s243a »

Anyway. Posting more source now. Part of my objective is to learn more about how puppy works, so I hope it doesn't bore anyone.

returning to the logs from the failed boot

Code: Select all

1: PDRV= P_BP_ID=fab3b011-746f-448b-85a3-5f7fb7f8e7f6 P_BP_FN= 
Comes from line 925 of

/initrd/init

Code: Select all

[ "$PDEBUG" ] && echo "1: PDRV=$PDRV P_BP_ID=$P_BP_ID P_BP_FN=$P_BP_FN"
we see this because it is the only echo statement which starts with "1:"

This statment always gets executed. However, the code to instead have PDEBUG as a boot parmater is commented out:

Lines 857 to 858

Code: Select all

#[ $pdebug ] && PDEBUG=$pdebug
PDEBUG=1
which makes since since there isn't really that much debugging information in this script. However, I suppose if it was a boot option one could have debug mode as one of their boot menu selections.

Here is the part where it searches for the USB Drives

Lines 947 to 959

Code: Select all

if [ "$LOOK_PUP" -o "$LOOK_SAVE" ];then #something to search for
 [ "${PMEDIA:0:3}" != "usb" ] && search_func
 if [ "$P_PART" = "" ];then
  wait_for_usb
  USBDRVS="$(find /sys/block -maxdepth 1 -name 'sd*' -o -name 'sr*' | xargs -n 1 readlink 2>/dev/null | grep '/usb[0-9]' | rev | cut -f 1 -d '/' | rev | tr '\n' '|')"
  [ "$PDEBUG" ] && echo "2: USBDRVS=$USBDRVS -> ${USBDRVS%|}"
  if [ "$USBDRVS" ] ; then
    search_func "${USBDRVS%|}"
  else
    search_func
  fi
 fi
fi
such_func (lines 742 to 783) will if they aren't already defined search for both the location of the main puppy files,

Lines 770 to 779

Code: Select all

   if [ "$LOOK_PUP" ];then
    find_drv_file "$P_BP_FN" "$P_DEF_FN"
    if [ "$ONE_FN" ];then
     PDRV="$ONE_PART,$ONE_FS,$ONE_FN"
     P_MP="$ONE_MP"
     P_PART="$ONE_PART"
     [ "$PDEBUG" ] && echo "5: ONE_PART=$ONE_PART PSUBDIR=$PSUBDIR P_BP_FN=$P_BP_FN P_DEF_FN=$P_DEF_FN"
     break;
    fi
   fi
and also the location of the save file

Lines 761 to 769

Code: Select all

  if [ "$ONE_MP" ];then
   if [ "$LOOK_SAVE" -a "$SAVEPART" = "" ];then
    set_fs_linux "$ONE_FS"
    find_save_file "$ONE_MP" "$ONE_PART" "$ONE_FS"
    if [ "$PUP_SAVES" ];then
     SAVEPART="$ONE_PART"
     [ "$PDEBUG" ] && echo "5: ONE_PART=$ONE_PART filename=${PSUBDIR}/${DISTRO_FILE_PREFIX}save"
    fi
   fi
I'm not sure if these have to be on the same partition


Here is the logic where puppy decides if and where to search for the puppy files and returns an error if it fails:

Lines 927 to 965

Code: Select all

#establish PDRV
P_PART=""; LOOK_PUP=""; LOOK_SAVE=""
if [ "$P_BP_ID" ];then #specified as parameter
 decode_id "$P_BP_ID"
 [ "$ONE_PART" ] && { P_PART="$ONE_PART"; P_BP_ID=""; }
 if [ "$P_PART"  = "" ];then
  wait_for_usb
  decode_id "$P_BP_ID"
  [ "$ONE_PART" ] && { P_PART="$ONE_PART"; P_BP_ID=""; }
 fi
 find_onepupdrv "$P_PART" "$P_BP_FN" "$P_DEF_FN" "p"
 [ "$ONE_FN" ] && { PDRV="$ONE_PART,$ONE_FS,$ONE_FN"; P_MP="$ONE_MP"; }
 [ "$PDEBUG" ] && echo "2: ONE_PART=$ONE_PART ONE_FN=$ONE_FN ONE_MP=$ONE_MP"
elif [ "$PDRV" = "" ];then #not specified anywhere
 #determine what to search for
 [ "$PMEDIA" = "cd" ] && LOOK_SAVE="yes"
 [ "$SAVE_BP_ID" -o "$PSAVEMARK" ] && LOOK_SAVE=""
 LOOK_PUP=yes
 [ "$PDEBUG" ] && echo "2: LOOK_PUP=$LOOK_PUP LOOK_SAVE=$LOOK_SAVE PMEDIA=$PMEDIA"
fi
if [ "$LOOK_PUP" -o "$LOOK_SAVE" ];then #something to search for
 [ "${PMEDIA:0:3}" != "usb" ] && search_func
 if [ "$P_PART" = "" ];then
  wait_for_usb
  USBDRVS="$(find /sys/block -maxdepth 1 -name 'sd*' -o -name 'sr*' | xargs -n 1 readlink 2>/dev/null | grep '/usb[0-9]' | rev | cut -f 1 -d '/' | rev | tr '\n' '|')"
  [ "$PDEBUG" ] && echo "2: USBDRVS=$USBDRVS -> ${USBDRVS%|}"
  if [ "$USBDRVS" ] ; then
    search_func "${USBDRVS%|}"
  else
    search_func
  fi
 fi
fi
[ "$P_BP_ID" ] && { log_part_id "$P_BP_ID"; ONE_PART="$P_BP_ID"; }
[ "$PDEBUG" ] && echo "6: ONE_PART=$ONE_PART ONE_TRY_FN=$ONE_TRY_FN PDRV=$PDRV"
if [ "$PDRV" = "" ];then
 [ "$ONE_TRY_FN" ] || ONE_TRY_FN="$PSUBDIR/$P_DEF_FN"
 fatal_error "$ONE_PART $ONE_TRY_FN not found." "Finding puppy main sfs file."
fi

Again these are just notes to myself but maybe someone else will find it useful. When I learn more there will be more explanation and less code snippets.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#18 Post by s243a »

bigpup wrote:If the Grub4dos bootloader is on the same USB hard drive, sdd1 the first partition.

Tahrpup 6.0.6 is all installed on partition sdd4.
Everything including the save.
Nothing is in a directory, just on the partition.

Try this for a save parameter in the boot menu entry.

Code: Select all

psave=sdd4:/tahrsave
This assumes the save is a save folder.

Or using the uuid.

Code: Select all

psave=fab3b011-746f-448b-85a3-5f7fb7f8e7f6/sdd4:/tahrsave
If you use the uuid then you leave out the sdd4. A big downside of using sdd4 is that it won't work if I move the hard drive from one computer to another. I don't want to reboot now because I decompressed initrd.gz as noted above. I must learn how to remake initrd.gz. I found some links to read:

https://www.ibm.com/developerworks/library/l-initrd/
https://www.linuxquestions.org/question ... ost2305513
https://askubuntu.com/questions/777260/ ... img/777374
https://www.thegeekstuff.com/2009/07/ho ... nitrd-img/
https://linux.die.net/man/1/cpio
https://openvz.org/Modifying_initrd_image

I was just making some sourcecode notes tonight because I don't have time tonight to try to modify the script and even if I did I wouldn't know how to repack it yet.

P.S. I doubt that putting sdd4 instead of the uuid would make a difference. If you look at the log in my first post you see:

Code: Select all

mount: can't read '/etc/fstab': No such file or directory
sdd4 on /mnt/pdrv as  mount failed. 
So the init script was able to identify the partition from the uuid but the partion wasn't mounted fast enough in the puppy boot process.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#19 Post by bigpup »

OK,

Wish you luck.

If you come up with anything that makes stuff work better.

Put a post about what you did at Woof-CE on Github.
https://github.com/puppylinux-woof-CE/woof-CE
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#20 Post by bigpup »

I kind of had a problem with Fatdog 720 not giving time for the drives to be found and identified when trying to find the save.

They have a waitdev= option that can be put into the boot menu entry.
But I do not think it is an option in normal Puppies.

So you can see how to use it.
Here is the menu entry:

Code: Select all

title Fatdog64 (sdc6/Fatdog64720b)
  uuid 6b517a5d-03c6-4635-96c5-659b29518c84
  kernel /Fatdog64720b/vmlinuz   waitdev=5
  initrd /Fatdog64720b/initrd
waitdev=5 says to wait 5 seconds for devices to be found.

Without it, the process goes too fast and all the drives do not get loaded before the save is searched for.
Maybe see what they did to add this optional parameter.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

Post Reply