I have buildroot readonly bootable image, which is normally loaded via TFTP in PXE enviroment. Filesystem in unpacked into ram and remounted as rw. And accidentally I wished to boot it from a USB stick and modify root filesystem content. So I thought of a "patch" system.

In a readonly image I can embed some /etc/init.d script, that, upon start, checks for /dev/sd?? drives, tries to mount them to /mnt (one at a time), seeks for /mnt/patch.sh script and executes it, then unmount and proceed to next drive.

So basically I want to iterate through all availble drives PARTITIONS in system. How to do that in shell script? (I use busybox)

In a for loop, does a ? character in /dev/sd?? meets /dev/sda for example (which i want to avoid)?


busybox shell does not interpret bash. The Debian ash (dash) variant 0.3.8-5 was incorporated with busybox release 0.52 (07/'01).

There are several differences between ash/dash and bash.

ash man

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.