Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to create script to flash USB drive.

Featured Replies

Hello,

I am using unassigned devices to mount USB flash drives on unRAID 6.11.5. My goal is to format it with FAT32, copy the contents of an ISO file, copy the contents of a folder from unRAID, and then change a few files and parameters.

I seem to have most of the needed commands, but cannot make the device bootable. Here is what I have so far.

#!/bin/bash
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
## Available variables:
# ACTION - if mounting, ADD; if unmounting, UNMOUNT; if unmounted, REMOVE; if error, ERROR_MOUNT, ERROR_UNMOUNT
# DEVICE - partition device, e.g. /dev/sda1
# UD_DEVICE - unassigned devX designation
# SERIAL - disk serial number
# LABEL - partition label
# LUKS - if the device is encrypted, this is the partition device, e.g. /dev/sda1
# FSTYPE - partition filesystem
# MOUNTPOINT - where the partition is mounted
# OWNER - "udev" if executed by UDEV, otherwise "user"
# PROG_NAME - program name of this script
# LOGFILE - log file for this script

ISO=/mnt/user/Images/Deployments/USB/apps/Hiren\'s.BootCD.15.2.iso
ROOTDRV=/mnt/user/Images/Deployments/USB/Root

/usr/local/emhttp/webGui/scripts/notify -e "unRAID Server Notice" -s "USB Script" -d "Starting USB Creation" -i "normal"

sleep 10

/usr/local/sbin/rc.unassigned umount ${DEVICE}
sfdisk --delete ${DEVICE}
echo ',,c;' | sfdisk ${DEVICE}
/usr/local/sbin/rc.unassigned mount ${DEVICE}
sleep 10
sfdisk -A ${MOUNTPOINT}
mlabel -i ${MOUNTPOINT} ::${LABEL}

isoinfo -f -R -i $ISO | while read line; do
  d=$(dirname $line)
  od=${MOUNTPOINT}${d}
  [ -f $od ] && rm -f $od
  [ -d $od ] || mkdir -p $od
  isoinfo -R -i ${ISO} -x $line > ${MOUNTPOINT}${line}
done

rsync -a -v ${ROOTDRV} $MOUNTPOINT/ 2>&1

mlabel -i ${MOUNTPOINT} ::MYBOOT

/usr/local/sbin/rc.unassigned umount ${DEVICE}

/usr/local/emhttp/webGui/scripts/notify -e "unRAID Server Notice" -s "USB Script" -d "USB Drive is ready for use." -i "normal"

 

These are commands I picked up from around the web. They all seem to work so far except the device is not bootable. Or, rather, it does boot, but gives an error instead of the HBCD boot menu.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.