How to mount a USB drive in grub

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 9285
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to mount a USB drive in grub

Post#1 by Ed_P » 17 Apr 2026, 18:12

Normally when i boot Porteus everything is plugged in and mounted when the desktop opens. What I want to do is dismount the mounted USB drive and replace it with a new one using a script in terminal mode. I'd appreciate some command steps please. :happy62: The drive is (hd0, msdos1) or /mnt/sda1/

Added in 22 hours 27 minutes 32 seconds:
My quest really isn't intended for terminal, it's for doing the mount in grub2. Grub2 supports many bash commands but not all of them. :( It supports ls but not lsblk and not mount. :no:

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4561
Joined: 20 Mar 2012, 03:42
Distribution: v5.1-alpha*-64bit
Location: australia
Contact:

How to mount a USB drive in grub

Post#2 by ncmprhnsbl » 22 Apr 2026, 01:57

disclaimer: following statements are a product of reading the interwebs, not from actual use of grub :)
Ed_P wrote:
18 Apr 2026, 16:40
My quest really isn't intended for terminal, it's for doing the mount in grub2. Grub2 supports many bash commands but not all of them. :( It supports ls but not lsblk and not mount. :no:
which pretty much answers your own question: grub can't do this..
possibly more correct to say: grub-shell has some commands that you'd see in other shells, like bash.
clearly grub does mount things (in read-only) but not in any interactive way, beyond pointing at a drive in grub.cfg, but i don't think it unmounts anything..
all that (eg. unmounting,remounting rw etc) happens after linux(vmlinuz) is loaded and then initrd can do all sorts of stuff, after which the full system init can do even more..

it's a bit unclear to me what you're trying to do, or why..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 9285
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to mount a USB drive in grub

Post#3 by Ed_P » 22 Apr 2026, 06:17

ncmprhnsbl wrote:
22 Apr 2026, 01:57
it's a bit unclear to me what you're trying to do, or why..
I normally boot via grub2 ISOs but do have a USB install or 2. When I boot the ISOs I don't see the Porteus boot screen, I load the OS directly via grub2 menu code. When I boot the USB install I see the Porteus boot screen because my EFI boot settings boot mounted USB drives before grub2.

To work with a user having boot menu problems I needed to boot from one of the usb drives but without knowning which USB drive to use I thought a grub2 menu could identify a USB drive and then I could boot it or not.

Being able to chainload an ISO boot via grub2 would be nice also.

Post Reply