sdb switching to sda sometimes

Moderators: 666philb, Forum moderators

Post Reply
User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

sdb switching to sda sometimes

Post by gychang »

I boot the latest FP64 and bionicpup64 from a usb stick (sdc) but have the save files on the sda (SSD, frugal install) on a UEFI PC. I boot from usb since I occasionally boot ubuntu on sda (I tried to multiboot from SSD but was complicated due to ubuntu) usb. I use an external HD attached to usb 3.0 (usually mapped as sdb) for large file storage.

sdb is auto-mounted using pmount option on boot. I noticed this sdb is occasionally remapped to sda and causes problems with my scripts that access external HD.

There is no fstab on my PC. Is there a reliable way of always having the external HD mounted as sdb? Attached is from command of lsblk.

Attachments
lsblk.png
lsblk.png (139.96 KiB) Viewed 688 times

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

Clarity
Posts: 3449
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1419 times
Been thanked: 455 times

Re: sdb switching to sda sometimes

Post by Clarity »

Question

  • Is your USB HDD usually a permanent unit on this PC?

If so, always boot from your system's drive with simple addition to its GRUB2 boot entry copy'd from your ISOs of your Frugals (assuming you are frugal booting 2020-2021 WoofCE PUPs/DOGs).

Your lsblk is showing several units, one of which is not mentioned.

Another option that comes to mind: Use SG2D and always boot from the USB you set it up on. It will find and present all bootables it finds for your selection. This does not require changing the GRUBs of any you have. IF you choose this approach, you will be able to boot PUPs, DOGs, and Ubuntu variants found on the units of your PCs. SG2D can be implemented by reading here. You will ONLY need to do this ONCE for this and your future boots. Also, you will find that you should not need to ever use Frugal again because it not only allows you to boot your Frugals, but also it allows you to boot ISOs directly as if they are Frugals. SG2D allows your PUP(s) & Ubuntus to behave exactly the same as a Frugal or persistent boots. The 10 minute investment to do a SG2D USB is well worth the one-time effort.

Hope this helps

User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: sdb switching to sda sometimes

Post by gychang »

Like to try 1st approach. It is permanently mounted. Full lsblk is shown.

I am unclear as to GRUB2 boot entry.... I have also attached my grub.cfg entry from sdc1 (boot sector on usb stick). Appreciate the help.

Clarity wrote: Fri Mar 19, 2021 2:51 pm

Question

  • Is your USB HDD usually a permanent unit on this PC?

If so, always boot from your system's drive with simple addition to its GRUB2 boot entry copy'd from your ISOs of your Frugals (assuming you are frugal booting 2020-2021 WoofCE PUPs/DOGs).

Your lsblk is showing several units, one of which is not mentioned.

Hope this helps

Attachments
lsblk.png
lsblk.png (151.73 KiB) Viewed 650 times
grubcfg.png
grubcfg.png (82.55 KiB) Viewed 650 times

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

Clarity
Posts: 3449
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1419 times
Been thanked: 455 times

Re: sdb switching to sda sometimes

Post by Clarity »

Hi @gychang

Would you like to have the entries of your grub.cfg booted from your main Ubuntu drive? If so, add those entries to the main drive's grub.cfg and boot your Ubuntu or either of these entries whenever your PC powers on. In other words, your main drive will allow you to boot any of these with the added entries.

SG2D was only mentioned for the flexibility it provides.

Hope that helps.

TerryH
Posts: 591
Joined: Mon Jun 15, 2020 2:08 am
Has thanked: 130 times
Been thanked: 137 times

Re: sdb switching to sda sometimes

Post by TerryH »

I can't advise regarding which drive appears as sda, I would have thought that with the set up you have it would always be the internal drive that would be sda. The lsblk you show looks normal to me. I think that sdb/sdc would be the drives that would be problematic.

The reason for this post is another issue. From your grub.cfg I noticed that you have pmedia=atahd, as the drive is an SSD, I would think you would be better placed having pmedia=ataflash instead.

As @Clarity said it can be added to the ubuntu grub.cfg. If you do that that, it probably would be lost next time update-grub is run in ubuntu. You can add you puppy entries in a /etc/grub.d/40_custom. Just make sure you only append the menuentry stanzas and the
exec tail -n +3 $0 is not altered. When update-grub is run, the contents of 40_custom is appended to the grub.cfg.

New Laptop - ASUS ZenBook Ryzen 7 5800H Vega 7 iGPU / 16 GB RAM

gyrog
Posts: 598
Joined: Thu Oct 01, 2020 8:17 am
Location: Australia
Has thanked: 14 times
Been thanked: 183 times
Contact:

Re: sdb switching to sda sometimes

Post by gyrog »

@gychang, it's safest to assume that the name of any USB drive is unreliable,
so your scripts need to identify your partitions with either UUID's or unique LABEL's.

Your scripts can process the output from "blkid" to find the name of the drive with a given LABEL or UUID.

If you use this approach, then add unique LABEL's to each of your partitions,
UUID's are meaningless, and very long for Linux partitions.

User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: sdb switching to sda sometimes

Post by gychang »

I should've made it clear, lsblk I put up is when it is working properly. I have the initrd.gz, vmlinuz etc installed in sda (internal SSD), including save file, so pmedia=atahd is working correctly. Basically boot usb let's me choose Fossapup or Bionic.

I will try to modify 40_custom per your suggestion. thanks.

TerryH wrote: Fri Mar 19, 2021 4:09 pm

I can't advise regarding which drive appears as sda, I would have thought that with the set up you have it would always be the internal drive that would be sda. The lsblk you show looks normal to me. I think that sdb/sdc would be the drives that would be problematic.

The reason for this post is another issue. From your grub.cfg I noticed that you have pmedia=atahd, as the drive is an SSD, I would think you would be better placed having pmedia=ataflash instead.

As @Clarity said it can be added to the ubuntu grub.cfg. If you do that that, it probably would be lost next time update-grub is run in ubuntu. You can add you puppy entries in a /etc/grub.d/40_custom. Just make sure you only append the menuentry stanzas and the
exec tail -n +3 $0 is not altered. When update-grub is run, the contents of 40_custom is appended to the grub.cfg.

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: sdb switching to sda sometimes

Post by gychang »

I edited the 40_custom file and saved and ran the sudo update-grub in ubuntu. When I rebooted there is no menu choice for puppy...

Basically I copied grub.cfg from the puppy boot and added to the 40_custom file. What did I do wrong?

TerryH wrote: Fri Mar 19, 2021 4:09 pm

As @Clarity said it can be added to the ubuntu grub.cfg. If you do that that, it probably would be lost next time update-grub is run in ubuntu. You can add you puppy entries in a /etc/grub.d/40_custom. Just make sure you only append the menuentry stanzas and the
exec tail -n +3 $0 is not altered. When update-grub is run, the contents of 40_custom is appended to the grub.cfg.

Attachments
Screenshot from 2021-03-19 12-22-10.png
Screenshot from 2021-03-19 12-22-10.png (106.46 KiB) Viewed 607 times

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

TerryH
Posts: 591
Joined: Mon Jun 15, 2020 2:08 am
Has thanked: 130 times
Been thanked: 137 times

Re: sdb switching to sda sometimes

Post by TerryH »

I don't know why the grub.cfg wasn't updated as expected, the contents of the 40_custom should be appended.

New Laptop - ASUS ZenBook Ryzen 7 5800H Vega 7 iGPU / 16 GB RAM

User avatar
bigpup
Moderator
Posts: 6538
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 794 times
Been thanked: 1358 times

Re: sdb switching to sda sometimes

Post by bigpup »

Try this.
I assume you are trying to make the change when booted into Ubuntu.

You need execute permissions on the file /etc/grub.d/40_custom.

The terminal command

sudo chmod +x /etc/grub.d/40_custom

will add the execute permissions to the file.

After doing that, run

sudo update-grub

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: sdb switching to sda sometimes

Post by gychang »

I checked and it was already executable, but I followed your instructions anyway. No joy.... Still goes to ubuntu without any menu.

bigpup wrote: Fri Mar 19, 2021 9:10 pm

You need execute permissions on the file /etc/grub.d/40_custom.

The terminal command

sudo chmod +x /etc/grub.d/40_custom

will add the execute permissions to the file.

After doing that, run

sudo update-grub

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
bigpup
Moderator
Posts: 6538
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 794 times
Been thanked: 1358 times

Re: sdb switching to sda sometimes

Post by bigpup »

Still goes to ubuntu without any menu.

That could be because the Ubuntu bootloader grub.cfg has no timeout set or set to low, so the menu has no time to show, before booting the Ubuntu entry.

I assume Ubuntu is the default entry to boot.

In the grub.cfg file that is used by the Ubuntu boot loader.
See if someplace at the top it has anything similar to this.
set default=0
set timeout=5

they may not be together.
set default=0 ->> this says to auto boot the first menu entry.
set timeout=5 ->>this says to wait 5 seconds before booting the default entry. Set timeout=10 should make the menu pop up.

Example puppy grub.cfg

#
set default=0
set timeout=5

set menu_color_normal='yellow/blue'
set menu_color_highlight='black/cyan'

loadfont /boot/grub/fonts/DejaVuSansMono18.pf2
set gfxmode=auto
terminal_output gfxterm

menuentry "Puppy bionicpup64 8.0" {
insmod ext2
search --no-floppy --fs-uuid --set f632582b-df1f-471e-bc54-96fcde31c24a
echo "Loading vmlinuz"
linux /429/vmlinuz pmedia=usbflash pdrv=f632582b-df1f-471e-bc54-96fcde31c24a psubdir=/429 pfix=fsck,fsckp TZ=EST5EDT,M3.2.0,M11.1.0
echo "Loading initrd.gz"
initrd /429/initrd.gz
}
menuentry "Puppy fossapup64 9.5" {
insmod ext2
search --no-floppy --fs-uuid --set f632582b-df1f-471e-bc54-96fcde31c24a
echo "Loading vmlinuz"
linux /fossapup6495/vmlinuz pmedia=usbflash pdrv=f632582b-df1f-471e-bc54-96fcde31c24a psubdir=/fossapup6495 pfix=fsck,fsckp TZ=EST5EDT,M3.2.0,M11.1.0
echo "Loading initrd.gz"
initrd /fossapup6495/initrd.gz
}
if [ $grub_platform = 'efi' ]; then
menuentry 'System BIOS setup' {
fwsetup
}
fi
menuentry "Shutdown computer" {
halt
}
menuentry "Reboot computer" {
reboot
}

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: sdb switching to sda sometimes

Post by gychang »

after adding the lines in custom_40 file and running sudo update-grub, grub.cfg file seems to have changed as seen but still I don't get a choice of pups...

bigpup wrote: Sun Mar 21, 2021 1:34 am

Still goes to ubuntu without any menu.

That could be because the Ubuntu bootloader grub.cfg has no timeout set or set to low, so the menu has no time to show, before booting the Ubuntu entry.

I assume Ubuntu is the default entry to boot.

In the grub.cfg file that is used by the Ubuntu boot loader.
See if someplace at the top it has anything similar to this.
set default=0
set timeout=5

they may not be together.
set default=0 ->> this says to auto boot the first menu entry.
set timeout=5 ->>this says to wait 5 seconds before booting the default entry. Set timeout=10 should make the menu pop up.

Example puppy grub.cfg

#
set default=0
set timeout=5

set menu_color_normal='yellow/blue'
set menu_color_highlight='black/cyan'

loadfont /boot/grub/fonts/DejaVuSansMono18.pf2
set gfxmode=auto
terminal_output gfxterm

menuentry "Puppy bionicpup64 8.0" {
insmod ext2
search --no-floppy --fs-uuid --set f632582b-df1f-471e-bc54-96fcde31c24a
echo "Loading vmlinuz"
linux /429/vmlinuz pmedia=usbflash pdrv=f632582b-df1f-471e-bc54-96fcde31c24a psubdir=/429 pfix=fsck,fsckp TZ=EST5EDT,M3.2.0,M11.1.0
echo "Loading initrd.gz"
initrd /429/initrd.gz
}
menuentry "Puppy fossapup64 9.5" {
insmod ext2
search --no-floppy --fs-uuid --set f632582b-df1f-471e-bc54-96fcde31c24a
echo "Loading vmlinuz"
linux /fossapup6495/vmlinuz pmedia=usbflash pdrv=f632582b-df1f-471e-bc54-96fcde31c24a psubdir=/fossapup6495 pfix=fsck,fsckp TZ=EST5EDT,M3.2.0,M11.1.0
echo "Loading initrd.gz"
initrd /fossapup6495/initrd.gz
}
if [ $grub_platform = 'efi' ]; then
menuentry 'System BIOS setup' {
fwsetup
}
fi
menuentry "Shutdown computer" {
halt
}
menuentry "Reboot computer" {
reboot
}

Attachments
Screenshot from 2021-03-21 06-29-55.png
(185.54 KiB) Downloaded 14 times

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
bigpup
Moderator
Posts: 6538
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 794 times
Been thanked: 1358 times

Re: sdb switching to sda sometimes

Post by bigpup »

It would help us if you could post the actual grub.cfg file that is booting the computer.
Show us starting from line 1.
that image is at line 265.

These are in the wrong place.
set default=
set timeout=
They go at the beginning of it.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Clarity
Posts: 3449
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1419 times
Been thanked: 455 times

Re: sdb switching to sda sometimes

Post by Clarity »

And include the GRUB2 disk you are booting where that GRUB2 resides.

Using the custom (preferred by GRUB way) to update the GRUB is proper and is built-in to Ubuntu. BUT Puppy Linux, thus far, do not include the GRUB utilities (although I wish they would).

Al of the requested info can help narrow the problem into an understanding toward the solution

User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: sdb switching to sda sometimes

Post by gychang »

thanks for catching it. Attached is the line 1.
should I try manually editing the grub.cfg file despite the warning?

bigpup wrote: Sun Mar 21, 2021 2:01 pm

It would help us if you could post the actual grub.cfg file that is booting the computer.
Show us starting from line 1.
that image is at line 265.

These are in the wrong place.
set default=
set timeout=
They go at the beginning of it.

Attachments
Screenshot from 2021-03-21 07-55-32.png
(162.81 KiB) Downloaded 11 times

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
gychang
Posts: 554
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: sdb switching to sda sometimes

Post by gychang »

am not sure what u r referring to when u say GRUB2 disk.

2 attached photos, when I use the usb (sandisk) stick is to either boot into fossapup or bionicpup as seen in the first photo, when I boot without the usb stick I boot straight into ubuntu.

Clarity wrote: Sun Mar 21, 2021 2:37 pm

And include the GRUB2 disk you are booting where that GRUB2 resides.

Using the custom (preferred by GRUB way) to update the GRUB is proper and is built-in to Ubuntu. BUT Puppy Linux, thus far, do not include the GRUB utilities (although I wish they would).

Al of the requested info can help narrow the problem into an understanding toward the solution

Attachments
Screenshot from 2021-03-21 08-12-51.png
(106.06 KiB) Downloaded 11 times
Screenshot from 2021-03-21 08-10-11.png
(105.75 KiB) Downloaded 11 times

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

TerryH
Posts: 591
Joined: Mon Jun 15, 2020 2:08 am
Has thanked: 130 times
Been thanked: 137 times

Re: sdb switching to sda sometimes

Post by TerryH »

gychang wrote: Sun Mar 21, 2021 3:04 pm

thanks for catching it. Attached is the line 1.
should I try manually editing the grub.cfg file despite the warning?

bigpup wrote: Sun Mar 21, 2021 2:01 pm

It would help us if you could post the actual grub.cfg file that is booting the computer.
Show us starting from line 1.
that image is at line 265.

These are in the wrong place.
set default=
set timeout=
They go at the beginning of it.

Yes , in this instance you can change the timeout to allow time for you to change the boot stanza to use one of the puppy entries.

Note: You choose to attach details using screenshots. Your post today show several screenshots, they no longer exist when clicked. It would be much simpler to copy the text you are attempting to show and include it using code tags. Code is included by using the " </>" icon above the entry window. It makes it much simpler.

New Laptop - ASUS ZenBook Ryzen 7 5800H Vega 7 iGPU / 16 GB RAM

wanthinker
Posts: 33
Joined: Thu Mar 18, 2021 11:35 pm
Has thanked: 17 times
Been thanked: 1 time

Re: sdb switching to sda sometimes

Post by wanthinker »

I'm glad i wasn't the only one who noticed this problem...happened on quite a couple of puppies but never gave it much thought

Post Reply

Return to “Fossapup64”