Am I right in thinking that if my x86 hardware supports booting from USB, then it will be relatively simple to use a USB stick as the primary storage for the device?
Background - I have a small-form-factor x86 PC that I want to use to as a firewall/router, it has an old failing HDD in it that I don't want to use. I have a 16GB USB 3.0 memory stick lying around that I want to use as the primary storage of the device.
Can someone give me a few pointers on how to do this, or link to a tutorial? I know the basic steps will be:
- Build OpenWRT for x86
- Create a bootable Unix filesystem on the USB
- Copy the OpenWRT images into the correct places on the filesystem
Other than that, I'm a complete beginner to this.
P.s. - I want the USB storage to be read/write, so not truly a 'LIVE' USB.
I just realized this is way easier than I was making it out to be. Just complied an x86_64 image and imaged the squashfs img file to a USB using Rufus in DD Image mode.
Worked first time
So this wasn't quite as simple as I first thought... I have OpenWRT running from the USB but my settings are not getting persisted over reboots.
Is there something I need to do to get the file systems read/write?
I'm using the squashfs x86 images.
squashfs is a read-only filesystem. It typically is used in OpenWRT with an "overlay" filesystem in r/w mode.
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
You might consider building an image with ext4, which is a r/w filesystem. (I have not tried this.)
Also, if you haven't done so already, ensure that your BIOS is set to boot from the USB stick with higher priority than the internal drive.