Page 1 of 4

Can't create new disk image grater than 2 GB

PostPosted: Sat May 18, 2013 10:22 pm
by frikzy
Hello,
I succesfully upgraded my LCNS2 classic with fvdw-sl-14 firmware and firmware is really great. :applause
I tried to create new disk image of 40 GB to connect my TV via USB. I managed to create disk image of max 2 GB and then activate device mode. My TV recognized new USB-device and everything is OK, except this image is to small.
When I move slider to 40 GB (or any other size more than 2 GB) after some time (~15 minutes), I got a message: "disk image nr 1 with size of 40 GB created". And next to button "Delete disk image" there is a message: "Create command returned 0 but no disk image found?? no disk image available in disk-images share." All upper tree buttons are grey, so I can't activate device mode.
When I check in File share management, there is sometimes disk-images (but not every time).
I apreciate your help with this item.

Re: Can't create new disk image grater than 2 GB

PostPosted: Sat May 18, 2013 10:30 pm
by fvdw
I will see if I can reproduce this error

ps you need to delete the old image first

Re: Can't create new disk image grater than 2 GB

PostPosted: Sat May 18, 2013 10:33 pm
by fvdw
confirmed I get the same problem when trying to create a 5 GB image.
I will look at this tomorrow (too late now) sorry to keep you waiting

Re: Can't create new disk image grater than 2 GB

PostPosted: Sat May 18, 2013 10:34 pm
by Jocko
Maybe an issue with a timeout and the php script doesn't run upto the end...

Re: Can't create new disk image grater than 2 GB

PostPosted: Sat May 18, 2013 10:38 pm
by fvdw
it seem the image is created compltely (last trial with a 3 GB one) file was there.

Re: Can't create new disk image grater than 2 GB

PostPosted: Sat May 18, 2013 10:42 pm
by Jocko
I assume that the shell command runs upto the image is created but that the php parent process is killed by over timeout.

But as it's late I checked nothing to confirm my idea

Re: Can't create new disk image grater than 2 GB

PostPosted: Sat May 18, 2013 11:02 pm
by fvdw
if you create an image bigger then 2GB you get also the 3 top buttons grayed out after closing re-opening the webinterface, seems not be able to find the image, could be an error in filesize routine, the file is there in reality, so no timeout issue to my opinion To be checked tomorrow

Re: Can't create new disk image grater than 2 GB

PostPosted: Sun May 19, 2013 9:44 am
by Jocko
I looked at the php code and it is not a timeout problem but a php function that apparently does not return the correct value: FileExists on line 195 of the menu

Re: Can't create new disk image grater than 2 GB

PostPosted: Sun May 19, 2013 9:55 am
by Jocko
founded :-D

it's a php limit :fuming.

here an extract from php.net for the file_exists function
Note: Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results for files which are larger than 2GB.


So we must change some code lignes :evil:

Re: Can't create new disk image grater than 2 GB

PostPosted: Sun May 19, 2013 9:59 am
by fvdw
I had this in the past and found a way to use it, need some time to refresh the memory...
The adaption is also used in determining total disk size on information page

It was also present in usb-extras in the past but maybe someone changed it :whistle

---edit no filesize is still calculate ok it uses this code
Code: Select all
   // function filesize does not work on file larger then 2 GB
   exec("ls -al $img | awk '{ print $5}'",$out,$retval1);
   return round($out[0]/(1024*1024*1000));