LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partclone : option -c --clone (what is it for?) (https://www.linuxquestions.org/questions/linux-newbie-8/partclone-option-c-clone-what-is-it-for-4175675746/)

dezix 05-23-2020 06:01 AM

Partclone : option -c --clone (what is it for?)
 
Hi!

Using Partclone to save a part to an image file.

As manpage shows only :

Code:

...
-c, --clone
  Save partition to the special image format.
...


What does/changes the --clone option ?

What occurs if missing ?

Please,
put focus on ext4 FS if possible.


Thanks for sharing knowledge ;-)

cordx 05-23-2020 06:39 AM

Quote:

Originally Posted by dezix (Post 6126286)
What does/changes the --clone option ?

are you asking how issuing the command with the --clone option is different from issuing it with the -c option?

using the example from the man page:
partclone.ext3 -c -d -s /dev/hda1 -o hda1.img
are you asking how that is different from:
partclone.ext3 --clone -d -s /dev/hda1 -o hda1.img
?

Quote:

Originally Posted by dezix (Post 6126286)
What occurs if missing ?

it is unclear what you are asking here. what occurs if the -c or --clone option is missing? can you be more specific?

Quote:

Originally Posted by dezix (Post 6126286)
Please, put focus on ext4 FS if possible.

that part is covered fairly well in the man page.
Quote:

All partclone utils could be run like partclone.[fstype] is very smiliar fsck or mkfs. For example, for backup/restore hfsplus, just run partclone.hfsp

ext2, ext3, ext4 partclone.[ext2|ext3|ext4]
returning to the example above:
partclone.ext3 -c -d -s /dev/hda1 -o hda1.img
.ext4 (or 3 or 2 or any other supported file system) has to be appended to the partclone command to tell the system what it will be cloning or restoring.

dezix 05-23-2020 08:32 AM

Quote:

Originally Posted by cordx (Post 6126289)
are you asking how issuing the command with the --clone option is different from issuing it with the -c option?

I understand well that -c is the short syntax for --clone

What I'm asking is : " What means special image format "

This isn't explicitly explain in manpage and I didn't found further explanations anywhere else.

That's why I'm asking here.

shruggy 05-23-2020 09:39 AM

For starters, contrary to what its manual page says, the option -c is never used by partclone.dd. It only makes sense for partclone.[fstype] or partclone.imager. This allows just using partclone.restore when restoring the captured image to another device. In this case, the used fstype is recorded in the image, so specifying it when restoring is unnecessary.

Again, contrary to what its manual page says, partclone.restore cannot restore images captured by partclone.dd or by partclone.[fstype] without -c. For such images, use partclone.dd / partclone.[fstype] -r, accordingly. Obviously, you need to know how the image was captured to be able to restore it successfully in this case.

Further, -c cannot be used when capturing an image from stdin.

Now, see this my post in the FOG Project forum. HTH.

dezix 05-23-2020 09:55 AM

@shruggy :hattip:

Thanks a lot,
that's exactly what I was looking for.

dezix 05-24-2020 01:35 PM

I will just add the result of a test made with Partclone : v0.3.13
to save a sdxy part to an image file .pcl or .img without the -c option

This doesn't work => partclone only shows a list of available options as a wrong command has been typed.

So I will conclude that the -c option is required to save a partition as an image file.

shruggy 05-25-2020 07:33 AM

Thanks for testing it, I stand corrected then. FYI, partclone.imager in 0.3.13 is broken (one important line was commented out in the source), but the fix is simple: patch it in again ;). It was recently fixed in the upstream git repo, too.

dezix 05-25-2020 09:35 AM

I've even tested file name without extension too,
Partclone doesn't accept it no more.

In fact I suspect that Partclone without -c is expecting a device as -o argument


All times are GMT -5. The time now is 06:47 PM.