thias / glim

GRUB Live ISO Multiboot
652 stars 142 forks source link

Is a storage partition possible? #78

Open eodaman opened 3 years ago

eodaman commented 3 years ago

For example: a 128GB stick divided into two partitions, 64gb FAT32 for GLIM and 64gb ext4 for transferring and storing files. Is this possible?

Noctiflore commented 3 years ago

It is possible, but you would need to disable sanity check, lines 56-60 in glim.sh.

caston1981 commented 4 months ago

I am interested in this too. I would like to have a EXT4 partition and one NTFS partition. This could be for storage of iso files larger than 4gb if we can find some way to boot them.

I have manually resized the vfat partition after creating it with glim.sh and created two partitions one NTFS and EXT4 as follows:

lsblk /dev/sda NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 1 114.6G 0 disk ├─sda1 8:1 1 40.8G 0 part /media/chris/GLIM ├─sda2 8:2 1 30.8G 0 part /media/chris/GLIMEXT4 └─sda3 8:3 1 43G 0 part /media/chris/GLIMNTFS

Lines 41 to 81:

USBDEV1=`blkid -L GLIM | head -n 1`
#We still want to continue if there is an EXT4 or NTFS partition with the correct label.
#Here are some custom variables to check.
USBEXT4=`blkid -L GLIMEXT4 | head -n 1`
USBNTFS=`blkid -L GLIMNTFS | head -n 1`
#echo "Found NTFS partition: $USBNTFS"

# Sanity check : we found one partition to use with matching label
if [[ -z "$USBDEV1" ]]; then
  echo "ERROR: no partition found with label 'GLIM', please create one."
  exit 1
fi
echo "Found partition with label 'GLIM' : ${USBDEV1}"

# Sanity check : our partition is the first and only one on the block device
USBDEV=${USBDEV1%1}
if [[ ! -b "$USBDEV" ]]; then
  echo "ERROR: ${USBDEV} block device not found."
  exit 1
fi
echo "Found block device where to install GRUB2 : ${USBDEV}"
if [[ `ls -1 ${USBDEV}* | wc -l` -ne 2 ]]; then
  echo "That's interresting! ${USBDEV1} isn't the only partition on ${USBDEV}"

  # Check if either EXT4 or NTFS partition was found

if [[ -z "$USBEXT4" && -z "$USBNTFS" ]]; then
  echo "ERROR: No partitions labeled 'GLIMEXT4' (EXT4) or 'GLIMNTFS' (NTFS) found."
  exit 1
fi

# Indicate which partition was found (simple)
if [[ ! -z "$USBEXT4" ]]; then
  echo "Found EXT4 partition at $USBEXT4 labeled 'GLIMEXT4' for GLIM."
fi

if [[ ! -z "$USBNTFS" ]]; then
  echo "Found NTFS partition at $USBNTFS labeled 'GLIMNTFS' for GLIM."
fi

fi

I can now run the glim.sh script on my flash drive and build again without error. Output looks like this:

 bash glim.sh 
Found partition with label 'GLIM' : /dev/sda1
Found block device where to install GRUB2 : /dev/sda
That's interresting! /dev/sda1 isn't the only partition on /dev/sda
Found EXT4 partition at /dev/sda2 labeled 'GLIMEXT4' for GLIM.
Found NTFS partition at /dev/sda3 labeled 'GLIMNTFS' for GLIM.
Found mount point for filesystem : /media/chris/GLIM
Install for EFI in addition to standard BIOS? (Y/n) y
Ready to install GLIM. Continue? (Y/n) y
Running grub-install --target=i386-pc --boot-directory=/media/chris/GLIM/boot /dev/sda (with sudo) ...
[sudo] password for chris: 
Installing for i386-pc platform.
Installation finished. No error reported.
Running grub-install --target=x86_64-efi --efi-directory=/media/chris/GLIM --removable --boot-directory=/media/chris/GLIM/boot /dev/sda (with sudo) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
Running rsync -rt --delete --exclude=i386-pc --exclude=x86_64-efi --exclude=fonts ./grub2/ /media/chris/GLIM/boot/grub ...
GLIM installed! Time to populate the boot/iso/ sub-directories.