chenxiaolong / DualBootPatcher

Patches Android ROMs for dual boot support
https://dbp.noobdev.io
Other
530 stars 467 forks source link

BUG: Backup error if backup size is bigger than 4 Gb => Split DBP backup files to multiple archives #1103

Open klorinczi opened 6 years ago

klorinczi commented 6 years ago

When doing backup of a 32 Gb internal sdcard to external sdcard having FAT32 filesytem, the backup fails when reaching the 4Gb file barrier, while creating data.img.lz4.

Could be possible to implement splitting of backup archives into multiple files?

klorinczi commented 6 years ago

@chenxiaolong: may I attract your attention to this bug? This is a blocker bug, because it makes impossible to create backup to FAT32 external sdcard, if the internal sdcard size is bigger than 4 Gb.

Please fix this bug.

chenxiaolong commented 6 years ago

Working on this now. Should be done this week.

klorinczi commented 6 years ago

Thanks very much!

chenxiaolong commented 6 years ago

Please give the test build at #1144 a try. If you can, please test both backups and restores. By default, it will split at exactly 4 GiB.

If you use the command line to do the back up, you can pass the --split-size <size in bytes> argument to pick a different split size or --split-size 0 to disable splitting.

klorinczi commented 6 years ago

Thank you very much!

The first thing I tried was to backup system and boot, then restore to new extsd slot.

Unfortunately I got error when restoring. Attaching screenshot about error.

screenshot_20180523-175307

chenxiaolong commented 6 years ago

Thanks for the screenshot! Looks like you ran into a long standing issue. Restoring to an extsd-slot has probably been broken for a while.

Can you give the new test build at #1144 a try?

klorinczi commented 6 years ago

Strange. The previous backup is in place. But I get the message, that "There are no backups available to restore".

The backup dir is the same. The backup is there.

Can the latest patch cause this?

chenxiaolong commented 6 years ago

Hmm, interesting. The latest patch only affects the restore process after it has started. The app itself is completely unchanged.

Sent from my Galaxy Tab® S2

-------- Original message -------- From: Konrad Lorinczi notifications@github.com Date: 5/24/18 00:20 (GMT-05:00) To: chenxiaolong/DualBootPatcher DualBootPatcher@noreply.github.com Cc: Andrew Gunnerson chillermillerlong@hotmail.com, Assign assign@noreply.github.com Subject: Re: [chenxiaolong/DualBootPatcher] BUG: Backup error if backup size is bigger than 4 Gb => Split DBP backup files to multiple archives (#1103)

Strange. The previous backup is in place. But I get the message, that there is no backup available.

Can the latest patch cause this?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/chenxiaolong/DualBootPatcher/issues/1103#issuecomment-391583380, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAncbdEASoXcqsRputWh64tYTU5bwCk-ks5t1jUWgaJpZM4TxImj.

klorinczi commented 6 years ago

Further problem: can not create backup, I got crash.

Attaching screenshot.

screenshot_20180524-062634

klorinczi commented 6 years ago

Attached log. I hope it is the latest.

19740720.195112.tar.gz Date does not make possible to distinguish.

chenxiaolong commented 6 years ago

I see this in the crash log:

02-23 14:20:10.752 22621 24770 E AndroidRuntime: java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider from ProcessRecord{6e00a2e 22621:com.github.chenxiaolong.dualbootpatcher.snapshot/u0a92} (pid=22621, uid=10092) requires android.permission.MANAGE_DOCUMENTS or android.permission.MANAGE_DOCUMENTS                                                                                                                                                                                       

So Android denied DualBootPatcher access to the SD card, which would explain the "There are no backups available to restore" issue as well. Can you try selecting the backup directory from the settings again?

klorinczi commented 6 years ago
  1. DBP should drop an error dialog, when permission is denied.

  2. Reselected the backup directory. Now backup started.

  3. Backup stopped with error (File too large). Screenshot attached.

screenshot_20180525-123513 screenshot_20180525-124451 screenshot_20180525-124517

chenxiaolong commented 6 years ago

DBP should drop an error dialog, when permission is denied.

I'll check, but I'm not sure if this is possible. This is a device-specific bug in the Android framework.

Backup stopped with error (File too large). Screenshot attached.

OK, I think I know what the problem is. I thought FAT32 supported files up to 4,294,967,296 (2^32) bytes, but it looks like it only supports up to 4,294,967,295 (2^32 − 1) bytes. I'll update this and create a new test build.

chenxiaolong commented 6 years ago

Actually, Wikipedia is wrong about the FAT32 max file size. The max file size is UINT32_MAX - 1, which is 4,294,967,294 (2^32 - 2).

chenxiaolong commented 6 years ago

A new test build is available at #1144.

klorinczi commented 6 years ago

Thanks for the fix! The new build #1144 worked fine! Backup system & boot finished successfully & restore to extsd seemed to work.

But I got two problems. 1) when switching to restored rr585tmp extsd rom, I got warning that CRC is missing. Attached screenshot. 2) switching to the new rom, after reboot seems to hang for a while on boot screen, then reboots to recovery. I created logs from recovery. Attached logs.

screenshot_20180525-235348

19740720.195112.tar.gz

chenxiaolong commented 6 years ago

Awesome! Regarding your two points:

when switching to restored rr585tmp extsd rom, I got warning that CRC is missing. Attached screenshot.

I'll fix this later. It's caused by the sha512sum not being backed up. Once you hit Continue, it shouldn't show up again.

switching to the new rom, after reboot seems to hang for a while on boot screen, then reboots to recovery. I created logs from recovery. Attached logs.

I'll take a look at the logs now.

chenxiaolong commented 6 years ago

It looks like the logs tarball is the same one you attached from a few posts ago. Can you attach the latest one?

klorinczi commented 6 years ago

I moved out the old logs to avoid confusion. But the new log I got, has 0 byte size :-(

I will try again.

klorinczi commented 6 years ago

Made logs again. 19700123.193132.tar.gz 19700123.193252.tar.gz