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.
Asked
Active
Viewed 81 times
0
-
What would you want to do with the file(s)? – Kusalananda Jun 16 '20 at 14:08
-
Mounting as a joined ISO file, loop device. – Konstantin Jun 16 '20 at 14:14
-
A method must exist in Linux, to solve this problem, I think. – Konstantin Jun 16 '20 at 14:16
-
1Check the answers to this question, for solutions with network block devices, device mapper, or fuse concatfs. – meuh Jun 16 '20 at 18:11
-
1https://github.com/schlaile/concatfs but I can't use this program, doesn't work for some reason. I can compile, but after mounting, the target directory is inaccessible. – Konstantin Jun 17 '20 at 00:42
1 Answers
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
-
Unfortunately the file size isn't multiple of 512 bytes in my case. – Konstantin Jun 17 '20 at 03:01