While trying to make an automatic OS installer (via livecd) I stumbled over a phenomenon that I'm not sure how I can correct it.
I mount /mnt/source to a network drive where an iso file is located. Then I run the command:
gunzip -c /mnt/source/myRemoteFolder/myImage.iso | ntfsclone -r -O /dev/sda1 - Now the problem is when for example the file or the folder do not exist.....the whole command hangs up indefinitely.
Thus this means if the network connection (for whatever reason) has a hangup I have a problem at hands as the process just hangs up.
Now my question here is: What can I do to avoid the hangup? The problem cases are as I see:
- The mount fails....this I can check beforehand (so no problem here)
- The network connection is lost just before gunzip is run (hangup)
- The network connection is lost DURING the gunzip run (hangup)
As note: The reason behind how the command is structured is that I don't want to copy the file locally as I'm running from a live cd and want the image to be put on the only hard drive available. Maybe as additional info I'm using puppy linux as distribution but didn't tag it as I don't think that that is a possible reason for that behaviour of those 2 programs.