Imaging using partclone instead of partimage
-
Hi,
I have a need for 2 use cases (working on 0.33b base):
- ext4 support
- grub2 support
Let’s talk about ext4, because it appears to be easier (somehow). I’m going to use partclone.extfs instead of partimage. Problem is that the image types are not compatible, and partclone plays less nicely with .gz images than partimage. But that’s OK.
So I modified my FOG script in init.gz, and everytime the partimage save/restore occured for $osid == 50, I replaced it by the appropriate command for partclone. And guess what… it works
I’ll test a bit further, especially, I will try not to break the multicast more than need be, and I shall provide a patch for /bin/fog. Anyone interested? Remarks?
As for GRUB2, and other things (like UEFI), I think there are quite a more things to be done… GPT seems partially supported, so that’s a start…
Cheers
Gilou -
OK, here’s the patch, quick & dirty for those interested, it’s being worked on, and will certainly not work on a multicast environment. I’m still interested in being able to work on SVN, by the way.
[url=“/_imported_xf_attachments/0/443_partclone.diff.txt?:”]partclone.diff.txt[/url]
-
[quote=“Gilou, post: 19988, member: 3221”]OK, here’s the patch, quick & dirty for those interested, it’s being worked on, and will certainly not work on a multicast environment. I’m still interested in being able to work on SVN, by the way.[/quote]
Hello,
Do you have any detail instructions on how to replace partimage with partclone? where to start?
-
I’ve now added this to my init.gz file, hopefully it’s useful to all of you possibly. It’ll be in revision r1000 YAY!
Also,
Gilou, how did you figure out how to use partclone? I’ve been trying for quite some time.
Also, this is my buildroot that has resolving hostnames available. If you notice issues, please let me know so I can try to fix them.
-
Tom,
How did you add it to init.gz file, would you mind to tell me how to do it?
Thanks,
Hongyun -
Look up on my webpage.
[url]https://mastacontrola.com[/url]
It’ll give some info, but if it’s easier just update your fog to the current revision.
The quick and dirty method.
Download the patch Gilou provides to your fog server in the /tftpboot/fog/images directory.
Then open a terminal to your fog server.
[code]cd /tftpboot/fog/images; mkdir tmp; gunzip init.gz; mount -o loop init tmp[/code]
This is all one line. It cd’s to the images directory, creates a tmp directory. Extracts the init file and mounts it to the tmp directory you created.
Then run
[code]patch -p1 tmp/bin/fog < ./partclone.diff.txt; umount tmp; gzip -9 init; rm -rf tmp[/code]This patches the fog script, unmounts the tmp directory, gzips the file back to init.gz and removes the tmp directory.
Hope this helps.
-
Hi Tom,
Thank you so much for your reply. I will give it a try, hope it will fix my problem.
Hongyun
-
@[URL=‘http://fogproject.org/forum/members/gilou.3221/’][B]Gilou[/B][/URL] @Tom Great news getting partclone included into fog. The Both of you keep up the good work. THANK U
-
Hi Tom,
I tried it with a clean install of FOG 0.33, but it couldn’t upload properly, only 32256 byte got uploaded to the server. When I tried to upload with debug mode, I got the following error messages:
mv: Can’t rename ‘/images/7071bc7b70bd/d1p1.img.000’: No such file or directory
Do you know what may be the problem?
Thanks,
Hongyun -
The only thought that sticks out to me is the idea that it’s looking for the file d1p1.img.000 and I believe the system only makes the files d1p1.img
Just a thought, though I don’t think that’s fully the fix yet.
I’ll take a look into the bowels of the fog script for when it moves the file.
-
Found the issue.
So I’m correct.
The script makes the files d1p1.img
Then when it tries to move the files it runs:
mv ${imgpart}.000 ${imgpart}
I Imagine this is backwards as the .000 file doesn’t exist at all during this.
If you’re unafraid to play a little in the bowels, you can fix this.
Perform the steps in this as before.
Use your editor for editing the file
Look for the lines that say mv ${imgpart}.000 ${imgpart} and switch it so it reads: mv ${imgpart} ${imgpart}.000
That should help you out.
-
What about this line: mv ${imgpart}.000 ${imgpart} 2>/dev/null
change it as well? -
[quote=“Hongyun, post: 20096, member: 1117”]What about this line: mv ${imgpart}.000 ${imgpart} 2>/dev/null
change it as well?[/quote]Yes, to my knowledge, there’s two lines that say the same thing. You’ll need to modify both.
-
Now I get the same error without 000
mv: Can’t rename ‘/images/7071bc7b70bd/d1p1.img.000’: No such file or directory
But I found the mac address folder under /images/dev/
-
One more question, do I need to have partclone installed on FOG server?
-
No. Partclone becomes a part of the init.gz file.
-
[INDENT=1]So you mean the [FONT=Consolas]partclone.diff.txt file already included everything I need to use partclone?[/FONT][/INDENT]
-
Hi Tom,
Have you ever used clonezilla? someone recommends that for me, but if I could make FOG work with ext4, I really don’t want to switch to something else.
Hongyun -
That’s kind of the point behind partclone vs. partimage. That’s really the main difference between clonezilla and fog.
-
I’m sorry that this is taking so long. I’ve got the code base, I think, setup and ready to run, but I keep getting a funny error. I can’t build partclone natively within buildroot, but I’ve successfully built the binaries on my 64 bit system. I just created a 32 bit VM to see if I could create the binaries on that and have them run properly, though I don’t know how well that will actually work.
It’s a work in progress, that’s for sure.