Closed bence98 closed 1 year ago
I was looking over the resizing code for BTRFS and EXT4 today because I am having issues with it. It looks to me like it should be pretty straightforward to add F2FS support. I will start work on it later this week.
I was able to add resize.f2fs
and partclone.f2fs
very easily. I am starting the work for the expand and shrink functions.
@Sebastian-Roth I noticed that you had started a branch for a newer version of partclone. Should we continue that work and include F2FS support or add support to the current working version?
@rluzuriaga Great, thanks for looking into this! You are right. We still have the partcline-0320 branch open with the latest update of Buildroot (2022.02.6) as well. This has been in use by people who updated or installed FOG dev-branch after 9th of October this year. As we had no issue reports on this I will merge these changes into master some time this week. Have had this on my list anyway. Good you are reminding me. May I ask you to wait until this merge is done before you open a PR on the master branch?
Found some time just now and merged the mentioned branch. Feel free to send a pull request on F2FS support.
Okay, so I have done A LOT of research on F2FS so here are a few things I have learned.
resize.f2fs
can only expand the partition.rsync
all the data out of it, delete the partition, and make a new smaller partition. (I am still testing to see if this fully works without issues).partclone.f2fs
captures only the used space of the partition, but the image on FOG will still show up as the full size since the partition table was never changed.There are two ways I see that we could implement support for F2FS.
resize.f2fs
if there is more space on the drive.@Sebastian-Roth Any thoughts/preferences?
@rluzuriaga Thanks a lot for taking the effort and looking into F2FS support!
- Add support without shrinking the partition on an upload/capture.
I'd probably vote for this option because ... (see my comment below)
- If the tests are successful, add support for "shrinking" the partition with the method stated above.
I am really wondering where you find room to place the data temporarily to be able to delete and re-create the partition? This is a high risk operation in any case. As FOG defaults to resizable image type I don't have a great feeling for such a move of data.
Overall having F2FS support in general would be great. We don't support shrinking for some other common filesystems either (e.g. XFS, FAT32).
@rluzuriaga Any chance we can get this ready for merging into the official code?
@Sebastian-Roth Sorry I've been busy with work. I have been testing the changes and found some issues. I am working on those issues and should have a PR by the end of the week.
@rluzuriaga Great work, thanks! PR merged just now - see #54.
From FOGProject/fogproject#517
I installed Linux to an NVMe drive, and I heard that EXT4 is not great for flash-based media, so I chose to use F2FS as my root partition instead. Now I can't image it with FOG, as it fails with "No resizable partitions found". Using FOG 1.5.9, FOS kernel 5.15.68 on amd64 arch.
If I comment out the check in
fog_upload:63
, then it clones with Partclone.image, albeit slowly. A proper F2FS support would be much appreciated, withresize.f2fs
and Partclone.f2fs