Page 1 of 1

Restoring split ntfs image from CD/DVD fails to release DVD

Posted: Fri Sep 10, 2010 10:40 pm
by romao
I am having a problem when I try to restore an ntfs partition image splited in multiple CDs. I have made a Backup from my Windows 7 hard disk and I splited the fsarchiver files (option -s 3950) in order to fit in multiples Double Densities DVDs (8000M), the total amount of DVDs are 2.

This is my command line fsarchiver restore:

fsarchiver -od restfs /media/cdrom/stages/420000002806_copas.fsa id=1,dest=/dev/sdc2


When I execute the fsarchiver command to restore the ntfs partition from the command line above, the first archive and second archives (.fsa and .f01) in the first DVD are processed fine by fsarchiver, but when it prompted to the next file (.f02) that is in the second DVD, I couldn`t eject the first DVD, so the restore process couldn't go ahead.

I have done some research to see which process is avoiding DVD to eject and I found this after executing the following command in other console:

lsof |grep -i cdrom
ntfs-3g 9349 root 4r REG 11,0 4063125146 2503 /media/cdrom0/stages/420000002807_copas.fsa

So my conclusion is that ntfs-3g is holding the DVD, so I try to terminate 9349 process (ntfs-3g) with TERM (-15), but it refuses to die, so I kill it with KILL (-9) and the ntfs-3g process die.

I issued the lsof command again and it returned this:

lsof |grep -i cdrom
lsof: WARNING: can't stat() fuseblk file system /tmp/fsa/20100910-180242-00
Output information may be incomplete.


After that, I could eject the DVD and insert the new path for the next file (.f02) but fsarchiver failed with this output:

[errno=107, Transport endpoint is not connected]: datafile.c#147,datafile_write(): cannot write /tmp/fsa/20100910-180242-00/Windows/SysW0W64/Adobe/Shockwave 11/Control.dll: size 503808
oper_restore.c#877,extractar_restore_obj_regfile_unique() removing /tmp/fsa/20100910-180242-00/Windows/SysW0W64/Adobe/Shockwave 11/Control.dll

What I could conclude is that when I killed ntfs-3g process in order to eject CD, I brought another problem that disconnected the ntfs partition from the filesystem (/dev/sdc2 mounted by fsarchiver in "/tmp/fsa/20100910-180242-00/" directory), so the fsarchiver couldn`t go ahead.

This is a sample of the fsarchiver log file :

Creating logfile in /var/log/fsarchiver_2010-09-10_18-02-38_9333.log
Running fsarchiver version=[0.6.10], fileformat=[FsArCh_002]
============= extracting filesystem 1 =============
executing [mkfs.ntfs]...
command [mkfs.ntfs] returned 1
executing [mkfs.ntfs -f /dev/sdc2 --label '<unknown>' -s 512 -c 4096 ]...
command [mkfs.ntfs -f /dev/sdc2 --label '<unknown>' -s 512 -c 4096 ] returned 0
Mount information: [streams_interface=xattr]
executing [ntfs-3g -h]...
command [ntfs-3g -h] returned 9
executing [ntfs-3g -o streams_interface=xattr -o efs_raw /dev/sdc2 /tmp/fsa/20100910-180242-00]...
command [ntfs-3g -o streams_interface=xattr -o efs_raw /dev/sdc2 /tmp/fsa/20100910-180242-00] returned 0
-[01][ 0%][DIR ] /
-[01][ 0%][DIR ] /oracle
-[01][ 0%][DIR ] /oracle/product
....
...
-[01][ 79%][REGFILEM] /Windows/SysWOW64/Adobe/Director/M5drvr32.exe
-[01][ 79%][REGFILEM] /Windows/SysWOW64/Adobe/Director/M5if32.dll
-[01][ 79%][DIR ] /Windows/SysWOW64/Adobe/Shockwave 11
-[01][ 79%][REGFILE ] /Windows/SysWOW64/Adobe/Shockwave 11/Control.dll
File [/media/cdrom/stages/420000002806_copas.f02] is not found, please type the path to volume 2:
[errno=107, Transport endpoint is not connected]: datafile.c#147,datafile_write(): cannot write /tmp/fsa/20100910-180242-00/Windows/SysWOW64/Adobe/Shockwave 11/Control.dll: size=503808
oper_restore.c#877,extractar_restore_obj_regfile_unique(): removing /tmp/fsa/20100910-180242-00/Windows/SysWOW64/Adobe/Shockwave 11/Control.dll
executing [fusermount]...
command [fusermount] returned 1
executing [fusermount -u /tmp/fsa/20100910-180242-00]...
command [fusermount -u /tmp/fsa/20100910-180242-00] returned 0

Is this a bug of fsarchiver regarding ntfs partition restore because I used to backup and restore ext3/4 partitions in multiple DVDs without problems?

If there is anything I can do to help solving this problem, please be confortable to ask.

Re: Restoring split ntfs image from CD/DVD fails to release

Posted: Mon Apr 18, 2011 11:13 am
by morgoth
I have the same problem. I can't eject dvd because ntfs-3g is holding dvd.
Everything works fine, but only this one problem stops me from using fsarchiver.

Re: Restoring split ntfs image from CD/DVD fails to release

Posted: Mon Apr 18, 2011 1:31 pm
by romao
This problem was quite difficult to overcome... As you can see, you were the only one who answered since I have shown this problem some months ago.

I have solved partially the problem this way:

First I had to create an extra ntfs partition in the hard disk I will restore the system using fsarchiver and I copy all the files from DVDs to this partition. After that, I run fsarchiver pointing to this partition as the source of the restore files. At the end of the restore process, I delete this extra partition and I grow the last partition to use all disk.

Re: Restoring split ntfs image from CD/DVD fails to release

Posted: Mon Mar 19, 2012 9:22 am
by digitalblade
hi,

after a lot of test and headache i think that the problem is in fs_ntfs.c on ntfs_mount function at this point:

if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "ntfs-3g %s %s %s", options, partition, mntbuf)!=0 || exitst!=0)
{ errprintf("command [%s] failed, make sure a recent version of ntfs-3g is installed\n", command);
return -1;
}

ntfs_mount is called for each partition stored in the fsa archive when you restore a disk.

After some tests with some debug messages added by myself to this function, i've discovered a really strange thing (for me :) ).
If you add one scanf before and after the "if (exec_command..." you will see ntfs-3g as lock for cdrom!! seem like ntfs-3g lock the fsa archive opening them.

this is my poor test :

msgprintf(MSG_FORCE, "-TEST- ntfs-3g %s %s %s", options, partition, mntbuf);
fprintf(stdout, "stop_test_1\n");
scanf("%s", tmp);
if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "ntfs-3g %s %s %s", options, partition, mntbuf)!=0 || exitst!=0)
{ errprintf("command [%s] failed, make sure a recent version of ntfs-3g is installed\n", command);
return -1;
}
fprintf(stdout, "stop_test_2\n");
scanf("%s", tmp);

the mount parameters are identical for both partition.

I'm not a great c programmer so.. i finish my resources and i'm not be able to find a solution... hope for someone more skilled than me!


P.s. I hope that my explanation is clear, sorry for my really weird English :(

Thank you