Foxclone - linux image backup, restore & clone

Questions about applications and software
Forum rules
Before you post please read how to get help
User avatar
AndyMH
Level 12
Level 12
Posts: 4035
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Foxclone - linux image backup, restore & clone

Post by AndyMH »

racer-x wrote:
Sat May 09, 2020 4:58 pm
Just want to say thanks for this awesome s/w. It's definitely easier to use than clonezilla. I've been using it for the past two days creating and restoring between two Linux OS's. It's worked out great with only a couple of minor issues. Very well done.
You're welcome :), were the minor issues of your making or mine?
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
racer-x
Level 4
Level 4
Posts: 488
Joined: Sun Oct 02, 2016 9:05 am
Location: Retired

Re: Foxclone - linux image backup, restore & clone

Post by racer-x »

They were very minor. One issue is when I select the restore file, I have to do it twice for some reason. The other issue had to do with restoring an image with a swap partition. It wrote the swap partition, but it was listed as "Unknown". It was a quick fix with Gparted to assign it as linux-swap. The end results were successful in all cases.

sanmig
Level 3
Level 3
Posts: 170
Joined: Tue Dec 04, 2018 8:27 am

Re: Foxclone - linux image backup, restore & clone

Post by sanmig »

Andy,
I’m replacing a 256GB SSD (GPT, Win10) with a 2TB SSD and tried FoxClone:
No luck.
(I do not have an external adapter USB - M.2 so I wanted to clone from file to drive)

Full backup of drive (sda) to an ext USB (320GB) drive was successful.
But at clone from file to disk, at the last step:
When selecting the new 2TB (sda) target, FoxClone throws an error:
“Target too small
source partition ends at 238,47 GB
Target drive -184,98 GB
Shrink the source partitions and try again”
(the error message appears once more after “OK” as can be seen in the log file)

Smells like a calculation error within V37 (?), as the 2TB sda drive correctly reports
(3907029168 sectors) * (512 B each) == 2 TB:

Code: Select all

ubuntu@ubuntu:~$ pkexec blockdev --getsz /dev/sda
3907029168
ubuntu@ubuntu:~$ pkexec blockdev --getsz /dev/sdb
30277632
ubuntu@ubuntu:~$ pkexec blockdev --getsz /dev/sdc
625142448
ubuntu@ubuntu:~$ 
###
ubuntu@ubuntu:~$ pkexec parted -ls
Model: ATA Samsung SSD 860 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2000GB  2000GB  ext4


Model: Kingston DataTraveler 3.0 (scsi)
Disk /dev/sdb: 15.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End     Size    Type     File system  Flags
 2      104kB  2660kB  2556kB  primary               esp


Model: ASMT 2115 (scsi)
Disk /dev/sdc: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  320GB  320GB  primary  ext4

ubuntu@ubuntu:~$ 
This is the essential part of the FoxClone log file (it’s twice, as the message appears twice):

Code: Select all

### =====================================
# content of source is listed, nice,
# now selecting my sda SSD 860 2TB as the target drive:
# throws first window "Target drive too small" with -184.98GB error message
** function CloneCheck
** Source =/mnt/foxclone/sdc1/Foxclone LG gram/20200508.sfdisk
** TargetDrive =sda
** sfFile =true
** ---------------
** function DriveSize
** Drive =sda
** ---------------
** procedure termCmd
** CmdLine =pkexec blockdev --getsz /dev/sda
** ---------------
last sector on source=500117504
# ... sda is not selected ...
# ========================================
# after “OK” a second identical window "Target drive too small" is thrown:
** function CloneCheck
** Source =/mnt/foxclone/sdc1/Foxclone LG gram/20200508.sfdisk
** TargetDrive =sda
** sfFile =true
** ---------------
** function DriveSize
** Drive =sda
** ---------------
** procedure termCmd
** CmdLine =pkexec blockdev --getsz /dev/sda
** ---------------
last sector on source=500117504
### ============================================
# after clicking “OK” again there is no log entry until "Quit".
The last sector on source (500117504) is correctly listed but well below the target disk's last sector (3907029168).
I could email the full log dump if necessary?

User avatar
AndyMH
Level 12
Level 12
Posts: 4035
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Foxclone - linux image backup, restore & clone

Post by AndyMH »

I'll have a look tomorrow,let you know if I need any more information.

EDIT - debug is showing the source correctly at 500,117,504 sectors, so I think the problem is in target sectors, but unfortunately my debug code doesn't output target sectors, but you ran pkexec blockdev --getsz /dev/sda separately and got 3,907,029,168 sectors so a bit puzzled? Checked - both source and target sectors are int64, so not that.

As I said, I'll look in more detail tomorrow. I've got a 2TB backup drive in my desktop that I can run a quick check on. Might need you to do a bit of testing for me, are you okay with that?
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

sanmig
Level 3
Level 3
Posts: 170
Joined: Tue Dec 04, 2018 8:27 am

Re: Foxclone - linux image backup, restore & clone

Post by sanmig »

AndyMH wrote:
Sun May 10, 2020 4:11 pm
Might need you to do a bit of testing for me, are you okay with that?
Sure, no probs and no hurry! Will be back here in the afternoon.

Btw, you didn't reply to viewtopic.php?p=1804234#p1804234
esp. the networking necessity?

User avatar
AndyMH
Level 12
Level 12
Posts: 4035
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Foxclone - linux image backup, restore & clone

Post by AndyMH »

Fixed, or it will be shortly. Look for the V38 iso on the website later this afternoon (UK time).

Fault was mine, reproduced it on my desktop with a 2TB drive. I'd declared all the variables associated with source/destination sectors as int64 = okay, but then converted the output from pkexec blockdev --getsz /dev/sdX (which is a string) to an integer with StrToInt not StrToInt64. As your 2TB drive has 3,907,029,168 sectors and the max value of a 32 bit integer is 2,147,483,647 the net result was a negative number = failure :( .

Before:

Code: Select all

last sector on source, nvme0n1 =990449664
sectors on target, sdb =-387938128
sdb is a 2TB drive, sectors is a negative number = wrong.

Now fixed:

Code: Select all

last sector on source, nvme0n1 =990449664
sectors on target, sdb =3907029168
sdb now showing correct answer.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

drryan
Level 1
Level 1
Posts: 9
Joined: Tue Dec 30, 2008 10:28 am

Re: Foxclone - linux image backup, restore & clone

Post by drryan »

Thank you. Your efforts are sincerely appreciated.

O-rion
Level 1
Level 1
Posts: 49
Joined: Sun Feb 15, 2015 3:05 pm

Re: Foxclone - linux image backup, restore & clone

Post by O-rion »

Very curious to download and try ... but the server is extremely slow and times out. Any alternatives available?

User avatar
AndyMH
Level 12
Level 12
Posts: 4035
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Foxclone - linux image backup, restore & clone

Post by AndyMH »

Having problems with the website at the moment, uploaded the latest V38 and when downloaded the md5sums are wrong :(
PM me with your email address and I'll send you a link.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

O-rion
Level 1
Level 1
Posts: 49
Joined: Sun Feb 15, 2015 3:05 pm

Re: Foxclone - linux image backup, restore & clone

Post by O-rion »

Thank you. I've sent you a PM

sanmig
Level 3
Level 3
Posts: 170
Joined: Tue Dec 04, 2018 8:27 am

Re: Foxclone - linux image backup, restore & clone

Post by sanmig »

AndyMH wrote:
Mon May 11, 2020 11:41 am
Having problems with the website at the moment, uploaded the latest V38 and when downloaded the md5sums are wrong
I’ve downloaded v38-02 from your website, 1 MB/sec which is my max download speed.
The MD5sum was 4083d45… (website: 64bbd…),
and the very first 24 byte of the downloaded file are bad:
string(10) “../../php/“ and LineFeed (0A)
… can’t boot, after deleting that stuff downloaded file is OK.

Will try cloning this evening, thanks!

User avatar
AndyMH
Level 12
Level 12
Posts: 4035
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Foxclone - linux image backup, restore & clone

Post by AndyMH »

sanmig wrote:
Mon May 11, 2020 2:03 pm
I’ve downloaded v38-02 from your website, 1 MB/sec which is my max download speed.
The MD5sum was 4083d45… (website: 64bbd…),
and the very first 24 byte of the downloaded file are bad:
string(10) “../../php/“ and LineFeed (0A)
… can’t boot, after deleting that stuff downloaded file is OK.
I sent you a copy via 'we transfer' you should have got an email with a link.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

sanmig
Level 3
Level 3
Posts: 170
Joined: Tue Dec 04, 2018 8:27 am

Re: Foxclone - linux image backup, restore & clone

Post by sanmig »

AndyMH wrote:
Mon May 11, 2020 2:11 pm
I sent you a copy via 'we transfer' you should have got an email with a link.
All good, got it, but I wanted
a) to check your website (download speed, …)
b) see what the problem with the downloaded file is (md5sum, not bootable)
c) give you (or Larry78723) a hint to the issue:
Your uploader includes 24 bytes in front of the otherwise correct .iso-content so it has a different md5sum and can’t boot.

The wrong bytes are what I wrote above: string(10) “../../php/“ and LineFeed (0A)

It’s a similar issue to what happened with v35-02, only the additional bytes were different then (something containing my and/or your IP address).

Just delete the first 24 bytes after download:
I’ve compared the ‘we transfer’ and the “shortened” download, both have the correct md5sum from the website (64bbd…), bootable.

***
Then I’ve “cloned from file” using v0.38 and the old backup (from v37) to the 2TB sda, it took about one hour, no probs.
Win10 was booting from the new 2TB SSD with a warning that some internal checks + a reboot are necessary.
- After that, Win10 was OK.

Success! :P :P :P
Thanks!

sanmig
Level 3
Level 3
Posts: 170
Joined: Tue Dec 04, 2018 8:27 am

Re: Foxclone - linux image backup, restore & clone

Post by sanmig »

But Andy, I’d really appreciate you coming back to 2 points:

1) Networking enabled per default is scary, untrustworthy.
I’d urge you to disable that.

2) Did you include an automated check of the log files at the end?
Instead of cheering “success” a window must pop up saying “Errors occurred, check log files!” at the end of a backup.
I don't know about restore / clone, there's a window checking (?) something, but what exactly?

harry_fine
Level 1
Level 1
Posts: 8
Joined: Sat Aug 17, 2019 2:38 pm

Re: Foxclone - linux image backup, restore & clone

Post by harry_fine »

AndyMH I'm reading elsewhere that this type of cloning solution does not work in Linux, that you can't just restore a partition or disk. I'm no expert, but what I'm hearing is stuff like:
But there is a risk in this approach to backing up your system:

DD copies all bytes from one partition to another, as a continuous stream.

The Linux kernel relies on a special number called a UUID to distinguish one partition from another.

Each partition must have a unique UUID or the kernel cannot distinguish between partitions.

DD copies the UUID along with the data.

This means after a short time, two partitions have the same UUID, but this must never happen or the kernel can no longer determine which drive is being read and which written.

Remedy: NEVER USE DD. Copy files, not partitions.
The answer is that you cannot copy a working Linux installation and expect it to work if it is copied back to a new partition later. This problem is solved by reinstalling, not copying partitions or files.

If you copy the entire partition, the UUID problem comes up as explained above. If you copy only the files, and then restore them into a new partition that replaces an earlier one, the UUID problem comes up in a different form -- the old install expects one UUID, but the new partition has a different one.

The remedy is to perform a fresh install whenever a new Linux instance is needed.
I don't pretend to know what can and can't be done, but I know I'm very confused.

If a complete re-install is necessary on a crash, it really increases the time it takes to get back up and running, unlike a Windodws system where I can clone an exact copy.

sanmig
Level 3
Level 3
Posts: 170
Joined: Tue Dec 04, 2018 8:27 am

Re: Foxclone - linux image backup, restore & clone

Post by sanmig »

harry_fine wrote:
Mon May 11, 2020 5:22 pm
that this type of cloning solution does not work in Linux, that you can't just restore a partition or disk.
Well, I’m a Linux n00b, but what I understand is:
It depends. 8)

The UUID is unique for the particular partition.
You can not have two identical (“unique”) partitions in one machine, that would cause troubles.
But to have “harry123456789” in one machine and the same “harry123456789” in an other machine: No probs.

On the other hand, I have cloned a Win10 drive with 7 partitions from a small (256GB) SSD to a 2TB SSD, including all 7 UUID’s,
- and Win10 is not complaining about activation because all UUID’s are identical.
Even a Win7 running in an VM within Win10 is still activated - a different UUID would be a no go.
OK, now I can't have both SSD's in the same laptop ...

Also restoring a Linux partition will require the same UUID, otherwise it wouldn’t boot / find the drives to mount if you have set them in /etc/fstab.
But yes, two partitions with the same UUID in one machine = disaster.
(However, AFAIK you could change the UUID if you want, but take care with that idea …)

User avatar
AndyMH
Level 12
Level 12
Posts: 4035
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Foxclone - linux image backup, restore & clone

Post by AndyMH »

AndyMH I'm reading elsewhere that this type of cloning solution does not work in Linux,
I think sanmig has pretty much answered for me, you are wrong and I don't know where you got your information from? The only thing you have quoted that is correct is that it is dangerous for a newbie to use dd - it is very easy to screw up your system with it if you don't know what you are doing. That is why tools like foxclone, rescuezilla and to a lesser extent, clonezilla (not very user friendly) exist - to do the housekeeping around partition images. If they didn't work, nobody would be using them.

BTW - website now working properly again.
OK, now I can't have both SSD's in the same laptop ...
I have the same problem with one of my spare drives used for testing, now a clone of my backup drive which is auto mounted via fstab on boot :)

I'll have a look at the networking and see what I can do about the log file checks - was more interested in fixing the bug you found.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
bob466
Level 5
Level 5
Posts: 875
Joined: Mon May 15, 2017 5:23 am
Location: Australia

Re: Foxclone - linux image backup, restore & clone

Post by bob466 »

Hi Andy,

I see you've put a lot of work into Foxclone...so I thought I'd give it a try.

I downloaded Foxclone 38 and put it on a Flash Drive...I then created a Folder...Foxclone Backup on my 2TB external HDD.

I have a spare Internal 500GB HDD (not SSD) with Mint Cinnamon 19.1 with no Partitions...used space is 57.9GB. With my 2TB external HDD plugged in...I booted to Foxclone which created an Image to my Folder in just 11 minutes...the Image was compressed to 19.8GB...Great. :)

I then tried to Restore the Image...that's when the wheels fell off. :cry: Clicked...Restore and followed your instructions...then...Confirm Restore then OK.

Box says...Restoring Partition Table...Calculating Bitmap please wait...after waiting about 12 minutes and nothing was happening...I get...The Window Restoring Partition Table does not seem to be Responding...so at that point I shut it down. :(

I have another spare HDD with Linux Lite on it and exactly the same thing happened...creating the Image is easy and fast but can't Restore it. Image

Here is the Foxclone Image of Cinnamon 19.1 in my Folder...https://ibb.co/V9Jvs4W As you can see the Image was created but it wont Restore it...hope you can fix this...then you'll have a winner. Image
Linux For Ever...Windoze Never Image

User avatar
AndyMH
Level 12
Level 12
Posts: 4035
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Foxclone - linux image backup, restore & clone

Post by AndyMH »

Bob,

From your screenshot, I assume the partition you are backing up to is fat32, reason I say this is that the image files are split* and only show one partition backed up - sdb1. Is this correct or did you change the settings to split files?

Can you have a look at the log file - does it say okay or has it got errors in it (the absence of errors does not necessarily mean there isn't a problem).

Could you repeat both the backup and the restore, but, having booted the foxclone iso, open up a terminal and run foxclone as foxclone --dump. This will dump a lot of debug info to the terminal - copy/paste the output into a text file (one file for the backup and another for the restore) and save it on your current system (there is a 'how to' in the manual under troubleshooting). Send the text files as an attachment to help@foxclone.com and I'll see if I can figure out what is going wrong.

Andy

* If foxclone detects the destination for a backup as fat32 it automatically splits the backup files to avoid the 4GB file limit on fat32 partitions. This was introduced in V37.

EDIT - for completeness, could you also email the *.backup, *-log.txt and *.sfdisk files - they are all text files and there may be something in the content that helps.

EDIT2 - could you also try backing up to an ext4 partition with split files off (the default) so there is only one backup image file, then try restoring that. I have a suspicion that I may have introduced or uncovered a bug when I made the changes in V37 for fat32 partitions.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
bob466
Level 5
Level 5
Posts: 875
Joined: Mon May 15, 2017 5:23 am
Location: Australia

Re: Foxclone - linux image backup, restore & clone

Post by bob466 »

Hi Andy,

When you said my Seagate Portable HDD USB3 was fat32...I thought that can't be right as I only purchased it this year. :? All my other Portable HDDs are NTFS...anyway I opened Disk Manager and sure enough it's bloody fat32. :x

So I Re-Formatted it to NTFS and did it allover again and it worked just fine. Image

On my 500GB Internal spare HDD...Space in Use...58GB. Time taken to create Image...11 minutes 18 seconds. Image Compressed to 19.8GB. This is the Foxclone Image on my Portable NTFS HDD...https://ibb.co/dDTV5YM could you add a verification tool...so when the Image is made we know it's good...this would make the Software perfect. Image

To Restore Image...10 minutes 33 seconds and the best part is...everything on the Drive was Restored as it was before an Image was created and I can say...this is the only Linux Backup Software that does just that and I've tried plenty. As a matter of fact...the Re-Imaged Drive Boots up as though it had never been touched...Excellent work Andy. Image
Linux For Ever...Windoze Never Image

Post Reply

Return to “Software & Applications”