How to clone the Trisquel system?

36 risposte [Ultimo contenuto]
panties
Offline
Iscritto: 02/02/2021

I cannot use the live USB.
I need to install a new Trisquel system from/by/within this existence Trisquel system to a HDD.
Then I am going to try restoring a BackInTime snapshot of this system on the new system.
But if I can clone the current system to the HDD directly, it is the best.
I have tried this kind of things several times for these 2-3 years but I have not succeeded in it. I mean, I have read some documentations.

Malsasa
Offline
Iscritto: 12/01/2016

Do you know that GNOME Disk Utility has almost similar feature? Look
at hamburger menu and Create Disk Image.

panties
Offline
Iscritto: 02/02/2021

I cannot unmount the HDD of the base system. How to unmount?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

You must do that from a live system. It find it easier to clone a system that way: https://trisquel.info/en/wiki/cloning-system-or-how-make-copy-installed-packages-one-computer-another

panties
Offline
Iscritto: 02/02/2021

This system is designed to prevent the live system from being activated in case of an enemy attack.
In other words, it accepts only signed kernels. Is it possible to sign a kernel of a live USB system?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I have no idea. The instructions I pointed only require you to do a fresh install.

nadebula.1984
Offline
Iscritto: 05/01/2018

If the system only accepts signed operating systems, then it's Restricted Boot. You should stay away from this system.

However, there are still ways to "clone" an operating system (approved by the Restricted Boot mechanism). For example, you can use virtual machines and write the virtual disk image to physical disks.

Malsasa
Offline
Iscritto: 12/01/2016

Hello, fujisawa. I somewhat understood your limitations right now. I
think there is a discussion you can read here
https://superuser.com/questions/396800/is-it-possible-to-dd-the-current-disk-you-are-booted-off.
I think what you are asking is called "hot backup", or "hot cloning",
as the OS is active and not unmounted, right? I am sorry I cannot help
much, fujisawa.

panties
Offline
Iscritto: 02/02/2021

This seems like a good material for thought about paradox, because it seems to imply that the kernel cannot finish what it is doing, trying to clone or record the system state at a certain point in time. Furthermore, considering that an attribute of a continuum is stretchable, it may have something to do with the infinite nesting structure, or what mathematicians call baker's transformation. It seems that a user has no free to clone the system per owns at any given time on the restricted boot system. I would like to hear mathematician's opinion.

By the way, given the timeline, it's hard to address some of the posts here individually. Because it seems to lose the validity of the post I made to organize the discussion at that point and smooth the transition to the next phase of the discussion. Well, that's fine though, because only the so-called troll is returning some responses out of habit without much passion, and no other useful responses are not forthcoming from other users.

jbar
Offline
Iscritto: 01/22/2011

A similar aproach taken from siduction documentation. First create a file containing all the installed packages except libraries.

$ dpkg -l|awk '/^ii/{ print $2 }'|grep -v -e ^lib -e -dev -e $(uname -r)>/home/user/installed.txt

Then to install the packages from the file

$ sudo apt-get install $(<installed.txt)

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I believe that, without the grep selection, it is exactly the same. That selection is dubious: filtering out every package whose name starts with "lib" means in particular filtering out libreoffice, although it is certainly intended to only filter out libraries, and developers who installed packages whose names end with "-dev" probably want these packages on the cloned system (which is a "clone" anymore), although grep filters them out too.

jbar
Offline
Iscritto: 01/22/2011

Thanks, I will take that into account.

panties
Offline
Iscritto: 02/02/2021

OK, let's get my head straight. Sometimes when you are so absorbed in what you have to do to achieve a certain goal, it itself becomes a goal. This is not a good thing.
The goal is to clone my current Trisquel system on a different hard disk.
In order to implement the solution proposed by Malsasa and Magic Bakana, I need to do it from the live system. However, as mentioned earlier, this system is not capable of running a live system in case of an enemy attack. In order to boot the live system, you need to sign to the live system's kernel, but in order to sign to the kernel, you need to boot the live system. However, as mentioned above, this system is not able to boot the live system. I thought about using Virt-Manager to boot it, but even if it is possible, it probably needs the GPG data to sign the kernel of the system on the VM, and I don't know how to port it.
How can I port the GPG data to the Trisquel live system on the VM?
Is it even possible to do that in the first place?
Or do I need to run the live system directly on my current system? In this case, there is no need to port the GPG data.
As for jbar's suggestion, first of all, I don't see the point of excluding the library. And it looks like I still need a fresh install of the new system in this case to install the created file anyway. But this is not possible for the reasons mentioned above.
After all, is it impossible to clone this system to another HDD while it is running? Or worse, is it impossible to do a fresh install of the new Trisquel system on another HDD while this system is running?
"Clone" means exactly the same on something different.

edit:typo

lanun
Offline
Iscritto: 04/01/2021

> exactly the same on something different.

This is called a copy.

panties
Offline
Iscritto: 02/02/2021

You don't have to read my posts.

lanun
Offline
Iscritto: 04/01/2021

True. I can read your mind instead.

panties
Offline
Iscritto: 02/02/2021

I downloaded Trisquel Mini for the X60 and created a live USB on the system, but accidentally installed it on the HDD I was using then. In other words, I actually created a live HDD. Naturally the system started to behave strangely and I forced a reboot, but cryptomount could not find the system.
I reluctantly bought a $20 Ponoma test clip made of plastic and some metal and external-reflashed Coreboot. Then I did a fresh install of Trisquel.
Fortunately, I have a BackInTime snapshot on another removable disk, but how do I BackInTime? BackInTime could not find a proper file in the snapshot files.
By the way, I selected a certain kernel during the installation, then now the network is not available; neither the initial Intel LAN device and the USB adapter LAN device, nor the USB Wi-Fi adapter works.
In case I could not BackInTime, I think I need to port a proper kernel to the new system. Please tell me how to do it in detail? Or can I use LAN with this new system somehow?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

With Back In Time you can simply copy the content of the latest snapshot. If the filesystem on the removable disk is NTFS, I believe the permissions will not be correct.

panties
Offline
Iscritto: 02/02/2021

> With Back In Time you can simply copy the content of the latest snapshot.

The snapshot file names are all random alphabets and numbers like the onion sites or your GPG keys.
I can't attach a screenshot for some reason, but the snapshot file is organized in a 5 or 6 layer tree, there are a lot of the random name files and BackInTime did not recognize any of them as a target file of restoration.
What should I copy and to where?? with what?
And the file system of the removable disk is definitely ext4 if I remember correctly.

panties
Offline
Iscritto: 02/02/2021

I am trying to copy the 30GB snapshot file to /home/trisquel/.config/backintime/trisquel/1 according to the vague note on BackInTime setting page. But it is already getting slow (and hot) as usual (30MB/sec to 8.9MB/sec) and I know it will be under 20-30KB/sec. So it will take several hours to copy it. But I do not know if that is the correct place to copy.
Is the place correct? Or BackInTime will not recognize it as a restore file again? Is that faster to configure a new system from scratch as I always do?

It says that "If you snapshots are on a remote drive or if they are encrypted (in my case, both) you need to manually mount them first.", but how to mount it?? It seems that "man backintime" does not describe how to restore from a removable drive, which some users must want often.

Sorry, it already got 7.7MB/sec I mean it will save time if I could know the correct place to copy it. I should say I have kept cooling the machine? But yeah, I know when it got under 1MB/sec, I should give up it and start to configure the system from scratch as I always do.
Why it gets slower and slower is always one of the big mysteries. It is 6.6MB/sec right now.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I am trying to copy the 30GB snapshot file to /home/trisquel/.config/backintime/trisquel/1

Copy the files where you want them to be. Is you user login actually "trisquel"?

how to mount it?

When you plug your removable drive, it filesystems are automatically mounted. If you can access the desired content, it is mounted.

panties
Offline
Iscritto: 02/02/2021

> Copy the files where you want them to be.

Why it works? I created the file on /home/trisquel/.config/backintime/trisquel.

> Is you user login actually "trisquel"?

I'm a bit not sure what my user login means, but I think yes it is "trisquel".

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

Why it works? I created the file on /home/trisquel/.config/backintime/trisquel.

You may actually have found better instructions (potentially preserving the permissions) that what I was aware of. Could you link to them?

I'm a bit not sure what my user login means

It is the output of this command:
$ whoami

panties
Offline
Iscritto: 02/02/2021

> It is the output of this command:

It was "trisquel".

> You may actually have found better instructions (potentially preserving the permissions) that what I was aware of.

I don't understand what you are talking about.

> Could you link to them?

You mean to link from the file "last_snapshot" to the backup file which was made on the deleted Trisquel system?
I copied the backup file to "/home/trisquel/.config/backintime/trisquel/root/1".
Then after made a new backup file (without the encryption option, because I could not install encfs because of the network issue of the new system) on this new system, BackInTime created a backup file on "/home/trisquel/.config/backintime/trisquel/root/1/backintime/trisquel/root/1".
Interestingly, the two files were created in that directly those names are "20210710-..." and "last_snapshot" respectively.
I was going to rename the old backup file which was copied in the directly (/home/trisquel/.config/backintime/trisquel/root/1) to "1" to disguise BackInTime since it did not recognize it as a backup file.
But it did not work. Copying the file to the directly which has the long name does not seem to work, neither. I mind doing that for such a slight possibility because copying takes time. Since I cannot install encfs, I am not sure if it can decrypt the file in the first place? And since the network is somehow unavailable, should I reinstall a Trisquel system again in the first place?
I am starting not to care about that.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I don't understand what you are talking about.

You read somewhere that the backup should be copied to ~/.config/backintime/trisquel/root/1, didn't you? I was asking for a link (or oterhwise reference) to those instructions.

I also have trouble understanding you. What is the problem with the network connection. Is it wireless? Can't you get a wired connection?

panties
Offline
Iscritto: 02/02/2021

> You read somewhere that the backup should be copied to ~/.config/backintime/trisquel/root/1, didn't you? I was asking for a link (or oterhwise reference) to those instructions.

Ah I see. You can see the note, rather than instruction, on the setting page of BackInTime. Although it says only /backintime/trisquel/root/1. I grepped all files which contain the name backintime with Caja. But it has nothing to do with the fact that I let it (Trisquel) show the hidden .config file of backintime. Then I thought that it should be the one which I have to past the old backup file to.

> What is the problem with the network connection. Is it wireless? Can't you get a wired connection?

I am the one who wants to ask that. I don't like wireless anyway, as you may know. No, I can't get a wired connection. I told you that.

panties
Offline
Iscritto: 02/02/2021

OK, let's get this straight. The timeline will be confusing, but I can't afford to worry about that right now.
The main point now is that I have a backup snapshot that I made on the old system that has now already been overwritten. I want to use this snapshot file to restore the system. But this is a full system backup file encrypted with encfs, not just the home partition created without encryption. And for some reason which I don't know why the network is not working on the new system.

Firstly, is it possible to restore the old system on the current system from the encrypted full system backup file? Once again, installing encfs is beyond my skills since network is not available.

By the way, when I make backups in the future I will not encrypt it. And I will only make the home partition copy on the encrypted ext4 filesystem, on a removable disk.
However, I have failed to do this kind of thing before: I did not use BackInTime then though, I directly replaced the copied /home with the new system's /home. I'm guessing that the reason for the failure is that /usr and /etc or other /**** seem to have files associated with them as well. Would it succeed if I backed up only the home folder without encryption with BackInTime, not directly like I did, and restored it on another system?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

The snapshot file names are all random alphabets and numbers like the onion sites or your GPG keys.

Did you actually use Back In Time? By default, you should have a directory "backintime", containing a directory whose name is the hostname of the system that was backed up, containing a directory whose name is the login of the user who backed it up, containing a directory named "1", containing a (symbolic link to) a directory named "last_snapshot", finally containing a directory with your backup.

If "only" your home folder was backed up, you can keep on navigating to it (i.e., enter the directory named "home" and then the directory whose name is your user login) and then copy its content (including the hidden files, that Ctrl+H in a file manager should show) to your home folder.

panties
Offline
Iscritto: 02/02/2021

> Did you actually use Back In Time?

Yes I did. What do you mean?

> By default, you should have a directory "backintime", containing a directory whose name is the hostname of the system that was backed up, containing a directory whose name is the login of the user who backed it up, containing a directory named "1", containing a (symbolic link to) a directory named "last_snapshot", finally containing a directory with your backup.

I can't find anything like that on this fresh installed Trisquel system. Please show me the actual pathname of the directly in your Trisquel system like /home/banana/Downloads/backintime.

> If "only" your home folder was backed up

No, I only have the full system backup file. I was warned that if I were to restore this on another system, I might have a problem. However, I had had an experience where I backed up only my home partition and it was impossible to restore it, so I chose the full system backup this time. Is it possible to extract only the home folder data from this full file if a problem occurred?

panties
Offline
Iscritto: 02/02/2021

> Is it possible to extract only the home folder data from this full file if a problem occurred?

Actually a problem might be already occurring since the network is unavailable.
I think that extracted file also would be still encrypted. And without or even with encfs, I cannot decrypt it? Reinstall?

panties
Offline
Iscritto: 02/02/2021

OK, I reinstalled the system again and now somehow network is available, thanks God.
I have a BackInTime snapshot which is encrypted with encfs. This snapshot was created on the deleted old system.
I can install encfs now because network is available. And I would like to restore the old system to this new system before I forget the passphrase.
I would like to do this as soon as possible because it looks like I am already starting to forget the passphrase.
Is it possible to restore the previous system from this snapshot? BackInTime still doesn't consider this snapshot as a target for restore. Sorry for the confusion in the timeline of this thread, but it's not my fault.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

There is a button to "Restore the selected files or folders to the original destination": https://backintime.readthedocs.io/en/latest/mainwindow.html#files-toolbar

panties
Offline
Iscritto: 02/02/2021

In "https://backintime.readthedocs.io/en/latest/mainwindow.html#files-toolbar", it says that "If this button is grayed out you need to select a snapshot in Timeline.". But as you know, after a fresh install, you do not have any snapshot. So the button is of course grayed out because you do not have any snapshot yet.
There is a button at the down left corner which says "Restore Config". If I click this button, BackInTime seems to start searching a config file. I have a snapshot on the USB drive. But BackInTime does not recognize it as a config file... but what is a config file? Is not that something for restoring an old system?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

Using "Restore Config", can you navigate to the backup of your home folder in one of the snapshot folders on the USB drive, then to .config (you may need to right click to display the hidden files) and finally on the "backintime" folder? The desired configuration should be there.

If that does not work, have you tried to modify the "General" settings ("Where to save snapshots" and "Advanced") so that the "Full snapshot path" is correct?

panties
Offline
Iscritto: 02/02/2021

> Using "Restore Config", can you navigate to the backup of your home folder in one of the snapshot folders on the USB drive, then to .config (you may need to right click to display the hidden files) and finally on the "backintime" folder? The desired configuration should be there.

There might be the desired configuration. But since all the file names are composed of random alphabets and numbers, I think it is impossible to tell which one is my home folder, or .config, or backintime folder. Please take a look at the screen shot. Which one is my home folder? I guess maybe because I used that encfs thing to encrypt them, the names are composed of random things.

> If that does not work, have you tried to modify the "General" settings ("Where to save snapshots" and "Advanced") so that the "Full snapshot path" is correct?

I have just modified it. The current path is /media/trisquel/backup. Then I clicked the "Restore Config" button but BackInTime did not recognize it as... the target for restoring. As always.

Screenshot at 2021-07-14 10-35-13.png
Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I would try to execute that in a terminal:
$ sudo encfs /media/trisquel/Backup/backup /mnt
Can you then see your backup (including Back In Time's configuration) in /mnt?

panties
Offline
Iscritto: 02/02/2021

I see. Then after I mounted the backup files there, BackInTime finally recognizes it as that? I wonder why I am the one who has to decrypt it since when I encrypted it BackInTime was the one who encrypted it but anyway thank you for the instruction. But unfortunately, as I expected, I forget the passphrase. I am going to remember it, though. When I was younger, when I forget something, I was able to remember it with some time anyway. But recently, I got older, sometimes I cannot remember it until the end even with enough time. If it was yesterday, I might have been able to remember the passphrase so it is really regrettable ('З').