The officially official Devuan Forum!

You are not logged in.

#1 2021-12-29 22:12:55

oui
Member
Registered: 2017-09-02
Posts: 303  

how to clone "neutral" the in a partition existing os?

how to clone "neutral" the in a partition existing os, add only some own general settings (for ex. /boot + /etc/clock + /etc/fstab + /etc/keymap + /etc/localtime + /etc/ + ~/.mozilla, or ~/config/mousepad + ~/.config/Thunar + ~/.config/xfce4, this in case of XFCE4 install, -on other installations equivalent ones, the goal is to start with a immediately working system with only a well defined history and not all the steps from yesterday and days before. Note: fstab link / or not the main data partitions for documents, data etc. I use sda5 and would prefer bind them as sda5 to avoid to have an fstab with UUID's as they are different on my different on my diverse computers: main computer at home, not movable any more, computer with phone card and adequate phone interface, transformer computer usable also as touch screen tablet - all are relatively old DELL's, all with i7 and 4 .. GB RAM, but divers hardware).

at install bootloader from within new system, it's important *****!!!!!

Head_on_a_Stick did give us a solution for simple cloning:

Head_on_a_Stick wrote:
felixed wrote:

# install bootloader from within new system, it's important *****!!!!!

grub-install /dev/nvme1n1p6
update-grub

For non-UEFI systems it is strongly recommended to install GRUB's core.img to the block device rather than the partition. If it is installed to the partition it can be "lost" during fsck operations and is generally more fragile. GRUB itself will give a warning about this if it is attempted.

And it's also best to update the debconf database with the new location rather than running grub-install manually:

dpkg-reconfigure grub-pc
update-grub

EDIT: I did post a manual method earlier but changed my mind and deleted it. Here it is again but without the manual partitioning bit because I decided that was too likely to wreck the system if the wrong device was given...

So this presumes you have already partitioned and formatted the new drive, which is identified hereafter as /dev/sdX — replace X with the correct letter and use lsblk -f to check (it will show which partitions are already mounted).

First mount the two partitions (this presumes the first partition is for / and the second is for /home, correct as needed):

mount /dev/sdX1 /mnt
mkdir /mnt/home
mount /dev/sdX2 /mnt/home

Then copy the system over:

apt install rsync
rsync -aAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt
sync

Wait for the sync command to return the prompt to ensure the copy buffers are all flushed to the drive.

Now generate a new fstab and chroot into the system to install & configure the bootloader:

apt install arch-install-scripts
genfstab -U /mnt > /mnt/etc/fstab
arch-chroot /mnt
dpkg-reconfigure grub-pc
update-grub

Finally exit the chroot and un-mount  the drive:

exit
umount /mnt/home
umount /mnt

That's it.

Tank you very much Head_on_a_Stick, a great answer really!

The rest problem is to neutralise the history and preserve some general (also own) settings (or setting for the person for which you to that)  a explained above (or better, welcome!) and start the clone, after that not changed any more until the next snapshot, live in the RAM:

You get max. comfort (if you are not afraid, you can enter an remember in for ex. ~/.mozilla a lot of not critical user names, passwords , cookies (* ), links, and start configuration like opened tab for weather, for local news paper for my city with access data and rights, for local national or international news paper, for http://inputking.com for permanent access to about all East and Far East writing without to need to install and setting up special input methodes etc., but your complete NEW history will be forgotten at absolutely each level each time you shutdown or restart (including the terrible's /.cache and /.Trash from main device!

How to do that?

(it is easy in Puppy Linux! I do it actually with as well a DebianPup as a DevuanPup! Only start /system/puppy-liveCD, Fill up the 2 initial little windows and at the normally 3thd one, where you are invited to add in /root, add your /root/.mozilla as wished! 2 steps later same thing in /etc ! So simplify is that! You only can't change some structural definitions (for ex. mount /dev/sda5 directly in /home/spot through /etc/fastab, as this subdir is not really empty at start time, or reactivate xorg.conf with predefined values for a group of keyboard to commute easily via some windows key as the automatic detection overwrite all your choices after start)! so simply that in PuppyLinux live if you renounce or CAN NOT USE the old save file/save dir way from PuppyLinux (for ex. because you have to use 3 different computers where /dev/sda5 is always for all the place to save documents, data, files, including some /mnt/sda5/.wine with own and different content for each of the 3 or more computers!)

(* to avoid to have to have to much work to authorize for each site you visit at each next session, as of course, no cookie is present if you don't authorize (certain pages have fair cookies rules, other not! YOU have to appreciate the profit and the inconvenient...

Last edited by oui (2021-12-30 10:31:43)

Offline

#2 2021-12-29 22:20:49

oui
Member
Registered: 2017-09-02
Posts: 303  

Re: how to clone "neutral" the in a partition existing os?

the next problem would of course be:

how to do the same after a live start (as extix likes to do with the refacta tools!)?

theoreticaly easy but the refracta snapshot did until yet always end with error message concerning not enough memory, so no way to test more, And the next step would be after that how to include the above explained neutral settings?

The fascination of extix builds is the very simple live start without need of slim or more!

Offline

#3 2021-12-29 23:56:24

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: how to clone "neutral" the in a partition existing os?

oui wrote:

how to clone "neutral" the in a partition existing os, add only some own general settings (for ex. /boot + /etc/clock + /etc/fstab + /etc/keymap + /etc/localtime + /etc/ + ~/.mozilla, or ~/config/mousepad + ~/.config/Thunar + ~/.config/xfce4, this in case of XFCE4 install, -on other installations equivalent ones, the goal is to start with a immediately working system with only a well defined history and not all the steps from yesterday and days before.

Add any directories that are not wanted in the clone to the --exclude= list in the rsync command.

oui wrote:

how to do the same after a live start

Perhaps script the process and host it on (for example) GitHub so it could be downloaded and run from the live environment.

EDIT: or build a live image that already has the script included. See https://live-team.pages.debian.net/live … ex.en.html for instructions.

Last edited by Head_on_a_Stick (2021-12-29 23:57:21)


Brianna Ghey — Rest In Power

Offline

#4 2021-12-30 00:04:11

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,117  

Re: how to clone "neutral" the in a partition existing os?

.. host it on (for example) GitHub ..

.. keeping in mind of course that github nowadays is a Microsoft venture ..

Offline

Board footer