0

I have tried to download a 8GB ISO image file. Unfortunately the file system was FAT32 on the pendrive. Max file size was only 4GB. The download process was aborted at a point, but as I used wget for download, I got a partial file. Then I examined the incomplete file, for its size, and I continued the download with cURL, explicitely defining the byte range. After successful download I have two separate file parts. Question is, how can I handle them as one: some kind of virtual join, or kind of mount, without copying them really together. I have no free space for phisically joining them on hard disk, this is why I downloaded them onto a 16 GB FAT32 pendrive.

1 Answers1

1

You could try a RAID 0 assembly, but I'm not at all convinced it will work with partial blocks (i.e. your source files must be a complete number of blocks).

Here is a worked example for you to try before you attempt to join your real data

# Prepare two 10MB image files for the example
( echo hello; cat /dev/zero ) | dd bs=1M iflag=fullblock count=10 > /tmp/1.dat
( echo world; cat /dev/zero ) | dd bs=1M iflag=fullblock count=10 > /tmp/2.dat

Set up loop devices

l1=$(losetup --show --find /tmp/1.dat) l2=$(losetup --show --find /tmp/2.dat)

Join them as RAID 0

mdadm --build /dev/md12 --level raid0 --raid-devices 2 "$l1" "$l2"

You will now have /dev/md12 as a device through which you can read/write the two parts as one.

Tear-down is in reverse

mdadm --stop /dev/md12
losetup -d "$l1" "$l2"
rm /tmp/1.dat /tmp/2.dat

Frankly though, you'd be better off formatting your memory stick with a filesystem that can handle decent file sizes and downloading the ISO again.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287