I think what you are trying to accomplish two seperate things,
The First is scanning an entire partition for a specific string.
You shouldn't try to edit/read block devices, rather try mounting them first! with
sudo mkdir /media/iso
sudo mount -o loop path/to/iso/file/YOUR_ISO_FILE.ISO /media/iso
in your case.
Source
Then you can use the mentioned sed command.
Now the actual thing you're trying to accomplish (as far as I understand) is making a persistant live Installation.
This can be done two ways:
Installing Ubuntu to the USB drive itself
OR
Iso-booting with persistant storage.
You are probably trying to boot the ISO with persistant storage so your changes dont get lost upon reboot!
Now This article is a little old and in german, though it has worked for me and you are probably able to follow the command snippets of it after using google translate on the site :)
My Grub-script for persistant live boot is as follows, you can install it like seen here.
insmod part_gpt
insmod ext2
set root='(hd0,2)'
set isofile='/iso/ubuntu-21.10-desktop-amd64.iso'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,msdos2 4e3de29b-008c-4063-9376-c52f34c87225
else
search --no-floppy --fs-uuid --set=root 4e3de29b-008c-4063-9376-c52f34c87225
fi
loopback loop $isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile persistent quiet splash noeject
initrd (loop)/casper/initrd
The cryptic Text 4e3de29b-008c-4063-9376-c52f34c87225 is the UUID of the partition, the ISO is on. You can find yours using gnome-disks, g-parted or blkid /dev/sdX
I hope I could help you!