Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
that is a good question, I'd try mounting it then copying it over onto another plugged in mounted usb stick .. the question is now to finalize it so it boots like its been burned to it.
or set up some scripts that will take what you have done to your customizing config files then have it reproduce this effect unto another usb stick or create a iso to dd it to other sticks.
i'v seen where others have stated dd , well here are some pages on that subject,
You'd kind of have to test this to find what is best for you.
Ideas.
dd tends to work best on exact or larger. In most clones you may end up fixing a few things. Clonezilla should be able to clone it if you want a gui sort of clone. Going to image file may help then image to disk sometimes.
I guess the answer could involve sizes and partitions/formats and loader then include disk naming and ethernet naming.
Some distro's let you sort of automate or get some list of changes. Something like apt clone.
Gparted or other partition program can clone partitions pretty fast usually. Then clone the loader.
In general modern systems and modern distro's view most usb storage as an internal drive so most ways to clone a usb to usb would be similar to internal to internal.
I'd like to share how I finally managed to successfully mirror one Live USB with persistence and 2 partitions into another.
Please remember that my experiment went with one USB and one SD, but both with the same capacity.
I was beginning to venture into the path of creating my custom distro, which probably is still a reliable option only if you have already, finally and perfectly tweaked your own system; if you (like me) thinks you're not yet done and still learning, you may just want to mirror for backup/test purposes without having (in case of damages) to start all over the Live USB + tweakings.
The way I did in the end is insanely simple and definitely shorter than the introduction:
Code:
dd if=/dev/sdX of=/dev/sdY bs=512b
where sdX is the origin and sdY destination. In my case, USB to SD.
It kept everything: from background image to wifi configurations, from VPN to browser extension.
Definitely exactly what I wanted.
I only saw some odd lines while on the mounting process at the start up, so far seems to have not caused any problem and my guess are that the USD was on a different mount point than the SD.
So after the first successful test, I've decided to go further and tried a different set up: i've dd a Linux distro from a USB 32gb with live persistence and LUKS encryption to another 64gb USB, brand new.
After unpacking the new memory, i've only formatted to ext3 and the fired up the dd.
Again, everything seems successfully as I'm writing using this new clone.
The new USB kept all, nothing seems missed except an odd warning on browser launch without any significant impact on usability nor security.
Of course, out of 64gb, the dd only used the original 32gb, leaving same space for free, eventually to get handled by
Code:
gparted
(will study a bit how to merge a LUKS partition with one without, but this is another topic).
If this is a process you are likely to repeat for other machines, it would have been more sensible to create an iso of the usb, using dd, then create the clones from that, purely from a time consumption point of view.
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,479
Rep:
For future reference - there are some distros like AntiX & MX Linux that have all the necessary programs to create what you have been doing.
(Both are Debian based.)
(Sometimes, dd will not have enough room on another disk, & you could end up with a slightly corrupt installation, just be careful.)
dd is not reliable with encrypted partitions. It might work in your case. But it should not be relied upon to duplicate them correctly.
Well, so far 3 out of 3 clones perfectly worked. Last try was 32GB to a 64GB usb.
What kind of problem could you kindly warn for the dd with encrypted? From Disk, it seems all good so far.
If this is a process you are likely to repeat for other machines, it would have been more sensible to create an iso of the usb, using dd, then create the clones from that, purely from a time consumption point of view.
Mmmm...not sure have got what you meant. A persistent USB should work on any machine you plug...
For future reference - there are some distros like AntiX & MX Linux that have all the necessary programs to create what you have been doing.
(Both are Debian based.)
(Sometimes, dd will not have enough room on another disk, & you could end up with a slightly corrupt installation, just be careful.)
Thanks for your suggestions, but I am not sure I got your point: how dd could end up without enough room on another, same size, USB? Thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.