You are not logged in.
Aaargh, of course it would be uefi....yeah I don't think i've even got a uefi iso around here anyway, for sure I haven't tested one. crap.
All right, back to the drawing board. Like I needed another reason to dislike uefi.
I've used the utility to write over sticks that already had a second partition just fine, must be something with that uefi partition, and I guess it needs to stay, and also possibly some additional delay needed in the script.
Thanks again Altoid, this is all good info, smacking my forehead right now that I didn't even think about an efi-iso needing a 2nd partition on a liveUSB, seems like a regression if you ask me.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
Hello:
... of course it would be uefi...
I should have remembered the problems I had installing a UEFI *.iso to a USB stick.
And the multiple hoops I had to jump through to get it done
Fortunately ralph.ronnquist figured it out.
Have a read, it's fun. 8^/
... must be something with that uefi partition ...
A UEFI machine will not boot if there is no UEFI partition it can find on the boot device.
USB stick, HDD, etc.
... it needs to stay ...
Yes, at least to boot UEFI enabled hardware.
Now, if your script can look for empty/unformatted space (and find it) then Bob's your uncle.
You just don't touch any formatted space, whether it be hidden or not.
ie: with any format, just in case.
... possibly some additional delay needed ...
Maybe.
Or maybe it is something else.
Just a hunch, with the error being of an aleatory nature.
Thanks ...
You're welcome.
As to all this UEFI shit being a regression ...
Methinks we have not seen the tip of the iceshitberg yet.
Best,
A.
Offline
Yeah after sleeping on it, i'm not sure i'm inclined to put in the work to make it work with efi stuff, I have a couple machines here that will do efi but they're both in compatibility/legacy mode and i'm quite happy with them, and not willing to change that to test some stuff i'll likely never use. Efi is just shit, and I don't feel like stepping in it if I can help it.
It's been a fun project and an awesome learning experience, and now I have a super nice tool that i'll use regularly. Bonus: I un-installed the gnome-disk-utility because now I don't need it anymore, my utility actually does a trick the GDU does not.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
Altoid wrote:
devuan_chimaera_4.0.3_i386_desktop-live.iso
This *.iso file did not generate a #$%& UEFI partition when I wrote it to the SD Card.
That's right. the i386 doesn't do uefi. I'm not aware of any 32-bit uefi systems.
Offline
That's right. the i386 doesn't do uefi. I'm not aware of any 32-bit uefi systems.
Apparently Crunchbang++ does, the iso Altoid linked to is efi, and won't boot up a live-session on my machine.
Something really wrong with that iso anyway, it's bizarre, downloading it alone caused my browser to lock up at the end of the process. And just looking at it on a usb stick that I burned, it's got a whole lot of odd stuff on it I usually don't see on normal isos.
And it apparently requires an efi partition as Altoid mentioned just to (attempt) to boot.
Uefi is just shit. Pure shit. Like shit with a side of shit-sauce and a shit-shake with some turds on the side.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
mostly for future thread visitors and with respect to OPOT, just wanted to make others aware of EasyOS by Barry Kauler of PuppyLinux fame.
Be Excellent to each other and Party On!
https://www.youtube.com/watch?v=rph_1DODXDU
https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!
Offline
Hello:
... apparently requires an efi partition as Altoid mentioned just to (attempt) to boot.
Yes but not if you are booting a box with no UEFI.
eg: Asus 1000HE
You can just delete the UEFI partition with disks albeit not with gparted which does not see it.
My guess is that because of how the installer works now, any *.iso made for a post Chimaera/Bullseye kernel will produce a UEFI partition, independently of the kernel present in the installation.
This complicates everything.
eg: try to install Daedalus or any post Chimaera/Bullseye release on a USB drive.
All this UEFI, secureboot, apparmor, SELinux et al crap being imposed manu militari by the WinTel consortium will not end well for us.
Best,
A.
Offline
No, something in that iso is making that happen, I make liveUSB's all the time with daedalus based isos, my own, vanilla Devuan daedalus, even Devuan excalibur. It's not the kernel version triggering it. It's definitely the iso itself.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
Why would easyOS be pertinent to this topic? It doesn't even use the .iso format from what i've read? To be honest, from reading about it, I think Barry lost a marble or two after he stopped developing Puppy.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
Hello:
... because of how the installer works now, any *.iso made for a post Chimaera/Bullseye kernel will produce a UEFI partition ...
... something in that iso is making that happen ...
Knowing nothing of what goes on inside an *.iso or how it works, I did not accurately write what I meant to say.
So I will rephrase:
"... because of how the installer works now, any *.iso made for a post Chimaera/Bullseye kernel will [have the instructions to] produce a UEFI partition ..."
That would cover the making that happen you are making reference to.
From what I gather, it seems that it is not something you can weed out just like that.
ie: clip out a piece of script.
Which is why I said how the installer works now, thinking it is part of something more complicated.
I seriously doubt that the #!++ i386 *.iso has any/many UEFI enabled i386 boxes / laptops to be used in.
So why is it a UEFI enabled *.iso?
It is also systemd enabled, so it is a no go for me.
I just wanted a peek at the Openbox config files.
@greenjeans
Maybe you could take a minute to look at them and see if they can be 'dropped' into a Devuan Chimaera with an Openbox setup.
Best,
A.
Offline
Install openbox and do a diff on the files you're curious about against the ones in /etc/xdg/openbox. (probably menu.xml and rc.xml)
FWIW, not related to the installer isos, but refractasnapshot has a config option for enabling uefi boot or not. (you always get legacy boot) It's just a matter of turning on or off one (I think it's just one) function. Oh yeah, the devuan-live isos have the same option because the same function is used in live-sdk.
To test those other config files, drop them in ~/.config/openbox/ and fire up an openbox session.
Offline
Hello:
... a diff on the files you're curious about ...
... probably menu.xml and rc.xml ...
Right, those are the ones I'veen looking at.
...drop them in ~/.config/openbox/ and fire up ...
Yes. I was planning on doing that in my present 1000HE setup.
Re: enabling UEFI
... the devuan-live isos have the same option because the same function is used in live-sdk.
So the function to enable UEFI in the *.iso, be it installer or live, is in some part of the respective *.sdk?
If so, maybe the installer could have an option to turn it on/off, depending on the default setting.
As always, thanks for your input.
Best,
A.
Offline
I don't understand what you talk about.
Any choice between using UEFI bios and legacy bios is a choice on and for the target system, because it's the target system that decides how it boots, and at best a choice for the person installing.
An installer ISO image may be prepared to support either or both means of booting.
The installer software, when executed, may offer setup for either one or both means of booting into the installed system. One of the primary differences is then the requirements that the means of booting has on the target system's disk partitioning and filesystem choices. That is in the hands of the person installing.
Offline
Hello:
... don't understand what you talk about.
Should not be a surprise. 8^)
I have already owned to "Knowing nothing of what goes on inside an *.iso or how it works ..."
Among other things.
... using UEFI bios and legacy bios is a choice on and for the target system ...
... at best a choice for the person installing.
Right.
Remember my post asking about dd'ing devuan_daedalus_5.0.1_amd64_netinstall.iso to a USB stick?
It was eventually solved but not before you figured out all the hoops I should jump through to be able to get a bootable USB device.
Not precisely a choice for me or for any other Devuan user with a non-UEFI box.
The installer software, when executed , may offer setup for either one or both means of booting ...
Yes, if it boots.
@ralph.ronnquist: as always, thanks for your input.
@greenjeans: I think the original topic has gone MIA after the testing / project ended.
For neatness' sake, you may want to consider marking the thread as solved.
Notwithstanding, the problems this UEFI crap has brought to the table remain.
Best,
A.
Offline
@greenjeans: I think the original topic has gone MIA after the testing / project ended.
For neatness' sake, you may want to consider marking the thread as solved.
Not necessarily, the conversation has pivoted somewhat, but it has turned to discussion of the stumbling block itself, and perhaps a better understanding of that will help with expanding the script to include efi stuff.
I did spend a little time working on re-writing, but after several attempts i'm not quite there, so it's on the back-burner simmering while I try to gather more data and do more reading. I have a working prototype (mostly) that extends it to bypass the need for Mintstick, and does everything I want it to, wipe-format-write-add data partition. But again, that's gonna be useless for efi-only isos that may need the boot partition on the liveUSB.
Gonna be twice the amount of code just to deal with the useless efi crap.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
A UEFI machine will not boot if there is no UEFI partition it can find on the boot device.
True but.. The 'esp' and 'boot' flags don't need setting on the USB. UEFI will look in /EFI/ on the first partition, which must be FAT formatted. Other files can be on the same partition. Therefore an ISO built with UEFI support can be simply copied to a FAT formatted USB and will boot in UEFI mode.
Done like this a USB will also boot in mbr mode; with few and minor modifications, the 'boot' flag set and syslinux correctly installed.
It should boot in both cases exactly like the cdrom with the same splash and boot menu.
As for 32-bit UEFI machines, I heard of them but never seen one..
Offline
Hello:
... a USB will also boot in mbr mode; with few and minor modifications ...
I'm sure you will concur with me in that few and minor are basically relative concepts.
That said, consider having a read at the post I linked to earlier in this thread.
Having done so, reflect upon what place few and minor could possibly have in what transpired.
For a long time now, the established idea has been that any current Linux *.iso (in this case Devuan/Debian) properly dd'd to a USB stick would be able to boot from any machine, provided hardware compatiblity was complied with.
I'd say it is one of those essential parts of the jazz that Linux is all about.
eg: like TCP/IP
With the advent of this UEFI shitload and without having been said otherwise, it stands to reason the idea referenced above still stands.
If that is not what is happening, something is definitely wrong.
And having to apply any modifications, however few and minor, is neither convenient nor acceptable.
The implications of it being considered as such are huge and of significant and extensive reach.
I think my opinion reflects that of a great many Linux users.
As always, YMMV.
Thanks for your input.
A.
Offline
@Altoid, thanks for your input. I missed your linked post till now, what a battle!
All I can say about that without closer scrutiny: I have seen boot failure on USB drives which had grub previously installed (by design, accident , incorrectly or for another system) or had isohybrid previously dd'd.
What mostly worked here to sort that was, before any formatting, to zero out the mbr plus a bit more e.g.
dd if=/dev/zero of=/dev/sdX bs=512 count=4096
"few and minor modifications" in this case means simply copy the contents of /isolinux/ to /syslinux/ then copy /syslinux/isolinux.cfg to /syslinux/syslinux.cfg. On a properly prepared USB drive of course.
Apologies if this is somewhat off-topic but might help resolve *some* usb boot issues.
Offline
Hello:
... what a battle!
Indeed.
The intervention of one of our admins was decisive in solving the issue.
ie: both finding out what was going on and coming up with a solution.
... boot failure on USB drives ...
... grub previously installed ...
... or had isohybrid ...
No the case.
I always take the precaution of formatting as cleared with gparted.
More so if the drive has had anything previously dd'd to it.
Apologies ...
No need, a constructive exchange of opinions is always healthy.
Have a good week-end.
Best,
A.
Offline
Altoid is 100% correct here, you should at least be able to boot into a live-session on any machine with a non-efi hybrid-iso on a stick. I have booted up efi-only machines with Vuu-do many times, and even installed it on an efi-only machine with no compatibility mode. Mind you at boot you have to hit f12 on that machine after the beep to get the boot menu and select the hard-drive or it won't boot, but it works.
3rd time I tried to boot that #!++ iso I didn't even get the grub menu, whole screen went black and machine refused to do anything, had to do a hard shutdown. That iso when viewed in the file-manager has 10 folders and 1 efi.img file, plus a readme and some md5/sha256 stuff.
My isos have just 3 folders. That's it. Isolinux, Live, and the package list. (Refracta Snapshot kicks azz!)
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
Pulling this off the back-burner as it's bugging me, I use this script all the time and it works great for non-efi iso's, but now want to re-visit it to try and make it work with the extra partition created when using an efi iso. Does anyone know of a small simple hybrid-iso of some thing I can use for testing? No Crunchbang++ please, something really wrong wih those things.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
Okay, there seems to just be something odd about that crunchbang++ 32-bit iso, because i downloaded a 64 bit version of it and it didn't put up a second partition when i burned it with Mintstick. Ran the Fatstick utility on it and it worked perfectly.
Some thing wonky about that 32-bit iso, likely having to do with trying to use 32-bit with efi. Weird edge case scenario, I don't see a point in messing with the script just for that. I tried an iso of fsmithred's that works for both efi and non-efi systems, and it worked perfectly too.
I'm gonna call the script good, I added a little timeout in both to fix the last tiny sometimes-bug, and have been using it almost daily for a long time now, works great and fast. Here's the final scripts, GUI and cli-only:
#!/bin/bash
# Fatstick: This script is intended for use immediately after using Mintstick to create a
# liveUSB, it creates a 2nd partition for data in FAT32 on the remainder of the
# stick, i.e. if you have a 32 gig stick with a 4 gig iso on it, the script will
# create a 28 gig "DATA" partition in the empty space that follows the iso.
# Copyleft greenjeans 2025, use as you see fit.
# This is free software with NO WARRANTY, use at your own risk!
# Trap to ensure progress dialog is killed on script exit
trap 'kill $PROGRESS_PID 2>/dev/null' EXIT
# Function to display error dialog
error_dialog() {
local error_message="$1"
kill $PROGRESS_PID 2>/dev/null
yad --center --borders=20 --fixed --window-icon=error --title="Error" \
--height=150 --button="OK:0" \
--text="$error_message"
exit 1
}
# Must run with root privileges
if [ "$EUID" -ne 0 ]; then
error_dialog "This script must be run as root (use sudo or su)."
fi
# Display initial dialog
yad --center --borders=20 --title="Fatstick" --window-icon=drive-removable-media \
--fixed --height=325 --button="OK:0" --button="Cancel:1" \
--text="This utility is for use on an existing liveUSB that is using an ISO-9660 filesystem
that takes up the entire stick, i.e. the type made by the Mintstick image writer.
If there is space after the iso, this will create a secondary data partition with
a FAT32 filesystem (for maximum compatibility with all operating systems)
and label it 'DATA'. WARNING: If the stick has existing secondary partition(s),
the utility will overwrite them and you will lose any data stored on them.
Please ensure there is only one liveUSB with an ISO-9660 filesystem plugged
into your computer before using this utility or it will error out and close.
If you have not already plugged in a liveUSB, do so now before continuing.
Click 'OK' to proceed or 'Cancel' to abort."
if [ $? -ne 0 ]; then
exit 0
fi
# Start progress dialog in the background
yad --window-icon=drive-removable-media --progress --progress-text="working..." \
--no-buttons --fixed --borders=20 --center --pulsate --width=400 --auto-close \
--title="Creating new partition" &
PROGRESS_PID=$!
# Check for multiple USBs with iso9660 filesystems
ISO_COUNT=$(blkid -o device -t TYPE=iso9660 | wc -l)
if [ "$ISO_COUNT" -gt 1 ]; then
error_dialog "Multiple USB devices with ISO-9660 filesystems detected.\n\nPlease unplug all but one USB device with an ISO-9660 filesystem and try again.\n\nRun 'blkid -o list' to identify connected devices."
elif [ "$ISO_COUNT" -eq 0 ]; then
error_dialog "No USB with ISO-9660 filesystem found.\n\nRun 'lsblk -o NAME,FSTYPE,LABEL' and 'blkid' to diagnose."
fi
# Find the USB device with an iso9660 filesystem (Mintstick’s LiveUSB)
USB_PART=$(blkid -o device -t TYPE=iso9660 | head -n 1)
if [ -n "$USB_PART" ]; then
USB_DEV=$(echo "$USB_PART" | sed 's/[0-9]*$//')
fi
# Fallback to lsblk if blkid fails
if [ -z "$USB_DEV" ]; then
USB_PART=$(lsblk -o NAME,FSTYPE | grep iso9660 | awk '{print $1}' | head -n 1)
USB_DEV=$(echo "$USB_PART" | sed 's/[0-9]*$//' | head -n 1)
USB_DEV="/dev/${USB_DEV}"
fi
if [ -z "$USB_DEV" ] || [ ! -b "$USB_DEV" ]; then
error_dialog "No USB with ISO-9660 filesystem found.\n\nRun 'lsblk -o NAME,FSTYPE,LABEL' and 'blkid' to diagnose."
fi
# Unmount any mounted partitions on the USB
umount "${USB_DEV}"* 2>/dev/null
# Get the partition table and disk info
FDISK_OUT=$(fdisk -l "$USB_DEV" 2>/dev/null)
if [ -z "$FDISK_OUT" ]; then
error_dialog "Failed to read disk info with fdisk."
fi
# Extract the end sector of the iso9660 partition
ISO_END=$(echo "$FDISK_OUT" | grep "^${USB_PART}" | awk '{print $4}')
if [ -z "$ISO_END" ]; then
error_dialog "Could not determine end sector of iso9660 partition."
fi
# Extract total sectors
TOTAL_SECTORS=$(echo "$FDISK_OUT" | grep "^Disk $USB_DEV" | grep -o '[0-9]\+ sectors' | awk '{print $1}')
if [ -z "$TOTAL_SECTORS" ]; then
error_dialog "Could not determine total disk sectors."
fi
# Calculate start and size of the new partition
PART_START=$((ISO_END + 1))
PART_SIZE=$((TOTAL_SECTORS - PART_START))
# Check space (needs at least 1 MB = 2048 sectors)
if [ "$PART_SIZE" -lt 2048 ]; then
error_dialog "Not enough free space to create a new partition (need at least 1 MB)."
fi
# Proactively wipe ISO-9660 signatures to prevent Gparted detection issues
wipefs -a -t iso9660 "$USB_DEV" 2>/dev/null || {
error_dialog "Failed to wipe ISO-9660 signatures on $USB_DEV."
}
# Remove any existing secondary partitions
sfdisk --delete "$USB_DEV" 2 2>/dev/null
# Create a new partition using sfdisk
echo "start=$PART_START, size=$PART_SIZE, type=c" | sfdisk --append "$USB_DEV"
if [ $? -ne 0 ]; then
error_dialog "Failed to create partition on $USB_DEV."
fi
sleep 2
# Check if the new partition was created
NEW_PART="${USB_DEV}2"
if [ ! -b "$NEW_PART" ]; then
error_dialog "Failed to create partition $NEW_PART."
fi
# Refresh the partition table and wait for kernel to recognize new partition
partprobe "$USB_DEV"
sleep 2 # Give kernel time to update device nodes
for i in {1..3}; do
if [ -b "$NEW_PART" ]; then
break
fi
sleep 1
done
if [ ! -b "$NEW_PART" ]; then
error_dialog "New partition $NEW_PART not detected by kernel."
fi
# Format the new partition as FAT32
mkfs.vfat -n "DATA" "$NEW_PART" 2>/dev/null
if [ $? -ne 0 ]; then
error_dialog "Failed to format $NEW_PART as FAT32."
fi
# Verification of FAT32, 3 tries
for i in {1..3}; do
if blkid -o device -t TYPE=vfat | grep "$NEW_PART" >/dev/null; then
break
fi
sleep 1
done
if ! blkid -o device -t TYPE=vfat | grep "$NEW_PART" >/dev/null; then
error_dialog "Could not verify FAT32 filesystem on $NEW_PART, but partition was created.\n\nCheck with 'lsblk -o NAME,FSTYPE,LABEL'."
fi
# Close progress dialog before showing success dialog
kill $PROGRESS_PID 2>/dev/null
# Display success dialog
yad --center --borders=20 --timeout=5 --fixed --height=100 \
--window-icon=drive-removable-media --no-buttons --title="Fatstick" \
--text="Success! New partition $NEW_PART created with FAT32 filesystem, labeled 'DATA'."
#!/bin/bash
# Fatstick CLI: Creates a secondary FAT32 data partition on a liveUSB made with Mintstick.
# Copyleft greenjeans 2025, use as you see fit.
# This is free software with NO WARRANTY, use at your own risk!
# Function to display error message and exit
error_exit() {
local error_message="$1"
echo "Error: $error_message" >&2
exit 1
}
# Must run with root privileges
if [ "$EUID" -ne 0 ]; then
error_exit "This script must be run as root (use sudo or su)."
fi
# Display initial prompt
echo "This utility is for use on an existing liveUSB with an ISO-9660 filesystem"
echo "created by Mintstick. It will create a secondary FAT32 data partition labeled"
echo "'DATA' in the remaining space. WARNING: Existing secondary partitions will be"
echo "overwritten, and data on them will be lost."
echo ""
echo "Ensure only one liveUSB with an ISO-9660 filesystem is plugged in."
echo "Run 'lsblk -o NAME,FSTYPE,LABEL' or 'blkid' to check connected devices."
echo ""
echo "Continue? (y/n): "
read -r response
if [ "$response" != "y" ] && [ "$response" != "Y" ]; then
echo "Aborted."
exit 0
fi
# Check for multiple USBs with iso9660 filesystems
ISO_COUNT=$(blkid -o device -t TYPE=iso9660 | wc -l)
if [ "$ISO_COUNT" -gt 1 ]; then
error_exit "Multiple USB devices with ISO-9660 filesystems detected. Unplug all but one and try again. Run 'blkid -o list' to identify devices."
elif [ "$ISO_COUNT" -eq 0 ]; then
error_exit "No USB with ISO-9660 filesystem found. Run 'lsblk -o NAME,FSTYPE,LABEL' and 'blkid' to diagnose."
fi
# Find the USB device with an iso9660 filesystem
USB_PART=$(blkid -o device -t TYPE=iso9660 | head -n 1)
if [ -n "$USB_PART" ]; then
USB_DEV=$(echo "$USB_PART" | sed 's/[0-9]*$//')
fi
# Fallback to lsblk if blkid fails
if [ -z "$USB_DEV" ]; then
USB_PART=$(lsblk -o NAME,FSTYPE | grep iso9660 | awk '{print $1}' | head -n 1)
USB_DEV=$(echo "$USB_PART" | sed 's/[0-9]*$//' | head -n 1)
USB_DEV="/dev/${USB_DEV}"
fi
if [ -z "$USB_DEV" ] || [ ! -b "$USB_DEV" ]; then
error_exit "No USB with ISO-9660 filesystem found. Run 'lsblk -o NAME,FSTYPE,LABEL' and 'blkid' to diagnose."
fi
# Unmount any mounted partitions on the USB
umount "${USB_DEV}"* 2>/dev/null
# Get the partition table and disk info
FDISK_OUT=$(fdisk -l "$USB_DEV" 2>/dev/null)
if [ -z "$FDISK_OUT" ]; then
error_exit "Failed to read disk info with fdisk."
fi
# Extract the end sector of the iso9660 partition
ISO_END=$(echo "$FDISK_OUT" | grep "^${USB_PART}" | awk '{print $4}')
if [ -z "$ISO_END" ]; then
error_exit "Could not determine end sector of iso9660 partition."
fi
# Extract total sectors
TOTAL_SECTORS=$(echo "$FDISK_OUT" | grep "^Disk $USB_DEV" | grep -o '[0-9]\+ sectors' | awk '{print $1}')
if [ -z "$TOTAL_SECTORS" ]; then
error_exit "Could not determine total disk sectors."
fi
# Calculate start and size of the new partition
PART_START=$((ISO_END + 1))
PART_SIZE=$((TOTAL_SECTORS - PART_START))
# Check space (needs at least 1 MB = 2048 sectors)
if [ "$PART_SIZE" -lt 2048 ]; then
error_exit "Not enough free space to create a new partition (need at least 1 MB)."
fi
# Proactively wipe ISO-9660 signatures to prevent Gparted detection issues
echo "Wiping ISO-9660 signatures..."
wipefs -a -t iso9660 "$USB_DEV" 2>/dev/null || {
error_exit "Failed to wipe ISO-9660 signatures on $USB_DEV."
}
# Remove any existing secondary partitions
echo "Removing existing secondary partitions..."
sfdisk --delete "$USB_DEV" 2 2>/dev/null
# Create a new partition using sfdisk
echo "Creating new partition..."
echo "start=$PART_START, size=$PART_SIZE, type=c" | sfdisk --append "$USB_DEV"
if [ $? -ne 0 ]; then
error_exit "Failed to create partition on $USB_DEV."
fi
sleep 1
# Check if the new partition was created
NEW_PART="${USB_DEV}2"
if [ ! -b "$NEW_PART" ]; then
error_exit "Failed to create partition $NEW_PART."
fi
# Refresh the partition table and wait for kernel to recognize new partition
echo "Refreshing partition table..."
partprobe "$USB_DEV"
sleep 2
for i in {1..3}; do
if [ -b "$NEW_PART" ]; then
break
fi
sleep 1
done
if [ ! -b "$NEW_PART" ]; then
error_exit "New partition $NEW_PART not detected by kernel."
fi
# Format the new partition as FAT32
echo "Formatting new partition as FAT32..."
mkfs.vfat -n "DATA" "$NEW_PART" 2>/dev/null
if [ $? -ne 0 ]; then
error_exit "Failed to format $NEW_PART as FAT32."
fi
# Verification of FAT32, 3 tries
for i in {1..3}; do
if blkid -o device -t TYPE=vfat | grep "$NEW_PART" >/dev/null; then
break
fi
sleep 1
done
if ! blkid -o device -t TYPE=vfat | grep "$NEW_PART" >/dev/null; then
error_exit "Could not verify FAT32 filesystem on $NEW_PART, but partition was created. Check with 'lsblk -o NAME,FSTYPE,LABEL'."
fi
# Display success message
echo "Success! New partition $NEW_PART created with FAT32 filesystem, labeled 'DATA'."
Last edited by greenjeans (2025-07-01 19:24:05)
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline
So for the life of me I cannot find another iso that does that stuff the #!++ 32 bit does. But still, need to deal with it. Pragmatism won out in the end, I just modded the script to check for additional partitions, and if it has one or more extras, it generates an error dialog and exits the script performing no actions on the liveUSB. Done. Going into the new Vuu-do iso's i'm working on today.
https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded April 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
Offline