Hello folks,
I work as admin at a small company and got a problem restoring a backup with cpio. The background story is that we got an old server with Suse on it that had Samba installed and was being used for file exchange and storage. Last week the hard drive had a mechanical failure and stopped working. Luckily it had an external hard-drive attached on which backups were made periodically. I know very little about the setup of the server, since it was set up by my predecessor and he left no documentation about it. Since the server's hard disk is beyond repair I decided to try my luck with the backup unit. I got myself a computer that was lying around, burned a copy of Kubuntu and attached the backup unit to it. So far everything went smoothly. After having a look at the backup I found out it was in cpio.bz2 format, so I tried to restore the files. After a little bit of research on the Internet I found the following command:
sudo bzcat backup.cpio.bz2 |sudo cpio -i
The restoring of the files went smoothly until, about halfway, it stopped with following error message:
cpio: premature end of file
I tried unzipping the backup with ark, and managed to extract the cpio file, then I tried restoring it with:
sudo cpio -i
but I get the same error at the same point.
Since the written files are about half the size of the extracted cpio file, I suppose the rest of the backup is still in the cpio file. I had a look at the last file it was writing, and it appears to be some backup of an thunderbird inbox, which has a size of 2.3 GiB. From what I already read on different forums it seems that cpio has problems with big filesizes (over 2 GiB), so that seems to be the problem (I'm not really sure about this, but some of the threads I read pointed in that direction). If this is the problem, then I would be OK with cpio skipping this file (it doesen't seem to be particulary important) as long as I can restore the rest of the files. My problem is that I don´t know how to achieve this, on other forums I searched I din't find much advice and man cpio wasn't much of a help either.
At the moment I'm trying my luck extracting the backup with ark again (yes, I deleted my extracted cpio file when I found out it gave the same error), and, when it is finished, I will try to open the extracted cpio in ark.
So my questions are, basically, the following three:
-The problem I have, is it because of a limitiation when the file was written (in this case I can imagine that I'm in trouble) or is it some limitation when extracting?
-Is there any way I can tell cpio to skip this file (or any files that give this errors) and extract the rest of the files?
-Do you think that using ark instead of the command line cpio can solve my problem?
If you need any further information, feel free to ask, it's just that I don't know what information could be usefull to you.
Best regards, and thak you for reading my questions.
Joder Illi
I work as admin at a small company and got a problem restoring a backup with cpio. The background story is that we got an old server with Suse on it that had Samba installed and was being used for file exchange and storage. Last week the hard drive had a mechanical failure and stopped working. Luckily it had an external hard-drive attached on which backups were made periodically. I know very little about the setup of the server, since it was set up by my predecessor and he left no documentation about it. Since the server's hard disk is beyond repair I decided to try my luck with the backup unit. I got myself a computer that was lying around, burned a copy of Kubuntu and attached the backup unit to it. So far everything went smoothly. After having a look at the backup I found out it was in cpio.bz2 format, so I tried to restore the files. After a little bit of research on the Internet I found the following command:
sudo bzcat backup.cpio.bz2 |sudo cpio -i
The restoring of the files went smoothly until, about halfway, it stopped with following error message:
cpio: premature end of file
I tried unzipping the backup with ark, and managed to extract the cpio file, then I tried restoring it with:
sudo cpio -i
but I get the same error at the same point.
Since the written files are about half the size of the extracted cpio file, I suppose the rest of the backup is still in the cpio file. I had a look at the last file it was writing, and it appears to be some backup of an thunderbird inbox, which has a size of 2.3 GiB. From what I already read on different forums it seems that cpio has problems with big filesizes (over 2 GiB), so that seems to be the problem (I'm not really sure about this, but some of the threads I read pointed in that direction). If this is the problem, then I would be OK with cpio skipping this file (it doesen't seem to be particulary important) as long as I can restore the rest of the files. My problem is that I don´t know how to achieve this, on other forums I searched I din't find much advice and man cpio wasn't much of a help either.
At the moment I'm trying my luck extracting the backup with ark again (yes, I deleted my extracted cpio file when I found out it gave the same error), and, when it is finished, I will try to open the extracted cpio in ark.
So my questions are, basically, the following three:
-The problem I have, is it because of a limitiation when the file was written (in this case I can imagine that I'm in trouble) or is it some limitation when extracting?
-Is there any way I can tell cpio to skip this file (or any files that give this errors) and extract the rest of the files?
-Do you think that using ark instead of the command line cpio can solve my problem?
If you need any further information, feel free to ask, it's just that I don't know what information could be usefull to you.
Best regards, and thak you for reading my questions.
Joder Illi
Comment