Copy Easy to another pendrive? (Solved)

Moderator: BarryK

Post Reply
szept
Posts: 141
Joined: Wed Jan 11, 2023 5:37 pm
Has thanked: 21 times
Been thanked: 2 times

Copy Easy to another pendrive? (Solved)

Post by szept »

Hello,

I know I can do an EasyOS backup inside EasyOS, but is there a way to do it automatically or semi-auto to another pendrive? I mean I'd like to make a 1:1 copy of my EasyOS on 32GB pendrive to another 32GB pendrive - with the whole system as well as all files. How to do it in the best way? I mean I know I think I can copy easy-5.6.3-amd64.img, initrd, vmlinuz and files folder, but is that going to have all my system settings, desktop layout, mouse/keyboard shortcuts, browser history, etc.?

Thanks,
Damian

Running live-USB EasyOS-64_5.6.3

...and taxes are theft! -.-
https://321my.wordpress.com/pw/

User avatar
BarryK
Posts: 2244
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 548 times

Re: Copy Easy to another pendrive?

Post by BarryK »

Well, you could create a new drive:

Code: Select all

# easydd easy-5.6.3-amd64.img

Then use gparted to increase the working-partition to fill the drive.

Then click on the new working-partition icon to mount it. Say it is /dev/sdc2 and your current working partition is /dev/sdb2, then copy:

Code: Select all

# cp -a -f /mnt/sdb2/easyos/* /mnt/sdc2/easyos/
# cp -a -f /mnt/sbd2/easyos/.session /mnt/sdc2/easyos/
# sync

That should do it.

Geek3579
Posts: 245
Joined: Sat Jul 18, 2020 1:07 pm
Has thanked: 68 times
Been thanked: 62 times

Re: Copy Easy to another pendrive?

Post by Geek3579 »

I prefer to copy whole partitions using GPARTED, but it must be run as a standalone OS, which in my case I have on a USB. The LIVE ISO can be downloaded from: https://gparted.org/download.php. Once set up, it can be used repeatedly to quickly clone selected partitions.

Nevertheless, one should begin with an empty/unallocated target drive. All partitions on the target USB can be removed by creating a new partition table, eg msdos. A disk/USB can be then cloned ONE partition at a time, starting with the boot partition. Subsequent partitions should be pasted into selected unallocated space.

Most importantly the boot flag will need to be set at the end.

szept
Posts: 141
Joined: Wed Jan 11, 2023 5:37 pm
Has thanked: 21 times
Been thanked: 2 times

Re: Copy Easy to another pendrive?

Post by szept »

BarryK wrote: Mon Feb 26, 2024 9:15 am

Well, you could create a new drive:

Code: Select all

# easydd easy-5.6.3-amd64.img

Not sure if I get it right, so questions now... The

Code: Select all

# easydd

starts easydd and then I follow instructions and this is how I normally create EasyOS live USB, so what the

Code: Select all

# easydd easy-5.6.3-amd64.img

does? Same thing and that's just a shortcut to lead particular .img?

BarryK wrote: Mon Feb 26, 2024 9:15 am

Then use gparted to increase the working-partition to fill the drive.
Then click on the new working-partition icon to mount it. Say it is /dev/sdc2 and your current working partition is /dev/sdb2, then copy:

Code: Select all

# cp -a -f /mnt/sdb2/easyos/* /mnt/sdc2/easyos/
# cp -a -f /mnt/sbd2/easyos/.session /mnt/sdc2/easyos/
# sync

That should do it.

Ok, so I'm not sure why should I use GParted to increase the working-partition? I thought easydd does everything automatically, so to be honest, I thought I would create brand new EasyOS on my 2nd pendrive and then copy some (?) files to make clone. Why this looks more complicated?! :)
Are these the lines to clone all the system setting, desktop layouts, wallpapers, icons, mouse/keyboard shortcuts, browser history, etc.?

Geek3579 wrote: Tue Feb 27, 2024 6:02 am

I prefer to copy whole partitions using GPARTED, but it must be run as a standalone OS, which in my case I have on a USB. The LIVE ISO can be downloaded from: https://gparted.org/download.php. Once set up, it can be used repeatedly to quickly clone selected partitions.

Nevertheless, one should begin with an empty/unallocated target drive. All partitions on the target USB can be removed by creating a new partition table, eg msdos. A disk/USB can be then cloned ONE partition at a time, starting with the boot partition. Subsequent partitions should be pasted into selected unallocated space.

Most importantly the boot flag will need to be set at the end.

That sounds a bit more complicated than Barry's solution, so if I get his idea, I'll try that first, but thanks a lot for more ideas!

Regards,
Damian

Running live-USB EasyOS-64_5.6.3

...and taxes are theft! -.-
https://321my.wordpress.com/pw/

User avatar
Flash
Moderator
Posts: 889
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 44 times
Been thanked: 104 times

Re: Copy Easy to another pendrive? (Solved)

Post by Flash »

I think easydd does not update the partition table like Gparted does. If you use easydd, then when you boot you might get errors.
Edit: Oops, pay no attention to that, I was thinking of dd, not easydd. :oops:

Chaos coordinator :?
User avatar
BarryK
Posts: 2244
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 548 times

Re: Copy Easy to another pendrive? (Solved)

Post by BarryK »

Code: Select all

# easydd <name of image file>

Is one way of doing it. Run this to see aLI options:

Code: Select all

# easydd --help

The reason for using Gparted to increase the working-partition, instead of letting EasyOS do it at first bootup, is to make sufficient room for copying the files, as described in my previous post.

Yes, the "cp" instructions I posted will clone everything.

Caramel
Posts: 309
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 77 times
Been thanked: 50 times

Re: Copy Easy to another pendrive? (Solved)

Post by Caramel »

szept wrote: Sun Feb 25, 2024 3:19 pm

Hello,

I know I can do an EasyOS backup inside EasyOS, but is there a way to do it automatically or semi-auto to another pendrive? I mean I'd like to make a 1:1 copy of my EasyOS on 32GB pendrive to another 32GB pendrive - with the whole system as well as all files. How to do it in the best way?

I hope this isn't nonsense because no one suggested it .

Why not using the command dd(https://linuxconfig.org/Dd) ?

With a command like: dd if=/dev/sdb of=/dev/sdc conv=noerror,sync (Not use this command without examining it !)
In this example sdb is the original pendrive and sdc is the backup pendrive.

Be VERY CAREFUL with the letter in the "of=" part because all the data on this drive will be erased

User avatar
BarryK
Posts: 2244
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 548 times

Re: Copy Easy to another pendrive? (Solved)

Post by BarryK »

Caramel wrote: Thu Feb 29, 2024 3:33 pm

I hope this isn't nonsense because no one suggested it .

Why not using the command dd(https://linuxconfig.org/Dd) ?

Not nonsense, it will work!

As long as the target drive is the same size or slightly more storage capacity.
If the target drive is identical model, then no problem.
If a different model labeled as 32GB, it might be slightly smaller, which is not good, as it will truncate the end of the working-partition ext4 filesystem.

szept
Posts: 141
Joined: Wed Jan 11, 2023 5:37 pm
Has thanked: 21 times
Been thanked: 2 times

Re: Copy Easy to another pendrive? (Solved)

Post by szept »

BarryK wrote: Wed Feb 28, 2024 2:44 pm

Code: Select all

# easydd <name of image file>

Is one way of doing it. Run this to see aLI options:

Code: Select all

# easydd --help

The reason for using Gparted to increase the working-partition, instead of letting EasyOS do it at first bootup, is to make sufficient room for copying the files, as described in my previous post.

Yes, the "cp" instructions I posted will clone everything.

Ok, so this still looks for me as the safest way (and the solution I can understad). Just the part with GParted... Does it mean I can let EasyOS do the partition sizing during first bootup (after standard EasyOS pendrive installation via easydd) OR I can do it using GParted instead (so not doing at first bootup, but before - straight after the installation process via easydd)? Is that correct? The reason I'm asking is I don't want to screw something up. I mean I used GParted to format drives, especially before or during Ubuntu installation process and that wasn't too difficult, but I've no idea what EasyOS needs in terms of partition type and sizes, so I'm a bit worried I might stuck at something. However I'm happy to learn, so I appreciate if anyone can explain how to do the GParted working-partition sizing properly.

Regards,
Damian

Running live-USB EasyOS-64_5.6.3

...and taxes are theft! -.-
https://321my.wordpress.com/pw/

User avatar
BarryK
Posts: 2244
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 548 times

Re: Copy Easy to another pendrive? (Solved)

Post by BarryK »

szept wrote: Fri Mar 01, 2024 4:37 pm

Ok, so this still looks for me as the safest way (and the solution I can understad). Just the part with GParted... Does it mean I can let EasyOS do the partition sizing during first bootup (after standard EasyOS pendrive installation via easydd) OR I can do it using GParted instead (so not doing at first bootup, but before - straight after the installation process via easydd)? Is that correct? The reason I'm asking is I don't want to screw something up. I mean I used GParted to format drives, especially before or during Ubuntu installation process and that wasn't too difficult, but I've no idea what EasyOS needs in terms of partition type and sizes, so I'm a bit worried I might stuck at something. However I'm happy to learn, so I appreciate if anyone can explain how to do the GParted working-partition sizing properly.

Regards,
Damian

You have to do it with Gparted, exactly the steps I posted.

The working partition has to be resized by Gparted to fill the drive, the files then copied, then boot the new usb-stick.

The files have to be already in place at first bootup of the usb stick.

If you are too worried about all those steps, you can use the "dd" method as posted above, as long as the new usb-stick has storage capacity either exactly the same (same make and model) or greater.

Reiterating, if your current usb-stick is, say, /dev/sdb and the new one is /dev/sbc, then copy is simple:

Code: Select all

# dd if=/dev/sdb of=/dev/sdc bs=1M
# sync

...the "sync" is important to flush everything to the drive, either as shown above or as Caramel posted.
Also vital that you correctly identify that /dev/sdc is your new usb-stick!

For your information:
"if" means "input file"
"of" means "output file"
"bs" means "block size"

Specifying bs=1M isn't essential, just makes writing to a flash drive more efficient.

One extra detail about the "dd' method. It might be best to bootup some other Linux, so that you are not running from the usb-stick that you want to clone. Not essential though.

szept
Posts: 141
Joined: Wed Jan 11, 2023 5:37 pm
Has thanked: 21 times
Been thanked: 2 times

Re: Copy Easy to another pendrive? (Solved)

Post by szept »

Ok, I'll try that then!
Thanks a lot for help guys :)

Damian

Running live-USB EasyOS-64_5.6.3

...and taxes are theft! -.-
https://321my.wordpress.com/pw/

szept
Posts: 141
Joined: Wed Jan 11, 2023 5:37 pm
Has thanked: 21 times
Been thanked: 2 times

Re: Copy Easy to another pendrive? (Solved)

Post by szept »

BarryK wrote: Sat Mar 02, 2024 1:27 am

If your current usb-stick is, say, /dev/sdb and the new one is /dev/sbc, then copy is simple:

Code: Select all

# dd if=/dev/sdb of=/dev/sdc bs=1M
# sync

One extra detail about the "dd' method. It might be best to bootup some other Linux, so that you are not running from the usb-stick that you want to clone. Not essential though.

Ok, so I'm back and ready to do the backup pendrive! It turns out my backup pendrive [sdc] IS BIGGER than my pendrive with EasyOS [sdb], so I guess I can do the "shortcut 'DD' method".
Image

Do I just simply do the following:

Code: Select all

# dd if=/dev/sdb of=/dev/sdc bs=1M
# sync

and no gparted resize is required or do I have to create 2 partitions (with sizes as on the screenshot) beforehand?

Regards,
Damian

Running live-USB EasyOS-64_5.6.3

...and taxes are theft! -.-
https://321my.wordpress.com/pw/

williwaw
Posts: 1574
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 143 times
Been thanked: 288 times

Re: Copy Easy to another pendrive? (Solved)

Post by williwaw »

Do I just simply do the following:

Code: Select all

Code: Select all

# dd if=/dev/sdb of=/dev/sdc bs=1M
# sync

yes, dd will preserve the partition structure

dd from bigger to smaller is going to run out of room, leading to missing data

dd from a smaller to a bigger should leave unused space on the bigger, which is what you want for a backup if you wish to restore to the smaller later.

if you are duplicating an install and wish to utilize the unused space, you can use gparted to grow the partition

Post Reply

Return to “EasyOS”