LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-11-2018, 12:58 PM   #1
artax
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Rep: Reputation: Disabled
Cloning live usb distro to other devices/usb


Hello, hope i'm posting in the right place but could not find anything related to this.

I have installed a Debian distro, then tweaked it a lot: VPN, wallpapers, desktop settings, keyboard settings, network, persistence, encryption, etc.

Now, I am wondering which options I have to exactly mirror this live USB distro to other n usb without manually setting them all over.

I was going into the path of building a custom build, but the more I am diving into it the more I feel it is not my best option.

Shall I just backup some config files (and if so, wich ones) and then just copy on new live usb to have them instantly mirrored? Or what?

Thank you very much for your help.
 
Old 11-11-2018, 03:06 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: FreeBSD/Slackware-14.2+/ArcoLinux
Posts: 9,135

Rep: Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927Reputation: 1927
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,

https://wiki.archlinux.org/index.php/disk_cloning
https://www.howtoforge.com/tutorial/...tical-example/
https://unix.stackexchange.com/quest...rom-hdd-to-hdd

a usb stick is essentially another hdd

comparisons
https://en.wikipedia.org/wiki/Compar...oning_software

Last edited by BW-userx; 11-11-2018 at 03:16 PM.
 
1 members found this post helpful.
Old 11-11-2018, 04:48 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,217

Rep: Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926
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.

https://wiki.debian.org/Backup/Clone
 
1 members found this post helpful.
Old 11-17-2018, 04:22 PM   #4
artax
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.

Will keep updated if any problem shows up. Thanks
Quote:
BW-userx
and
Quote:
jefro
for suggestions!
 
Old 11-21-2018, 05:48 PM   #5
artax
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Talking

Update: 32 to 64 gb using just
Code:
dd


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).

Enjoy your cloning.
 
Old 11-21-2018, 06:42 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
dd is not reliable with encrypted partitions. It might work in your case. But it should not be relied upon to duplicate them correctly.
 
Old 11-21-2018, 09:14 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,217

Rep: Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926
Not sure why dd would be considered unreliable. Why do you say that?
 
Old 11-22-2018, 10:31 AM   #8
alexpaton
Member
 
Registered: Jul 2009
Distribution: Ubuntu & ClearOS
Posts: 163

Rep: Reputation: 47
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.
 
Old 11-22-2018, 10:49 AM   #9
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,119

Rep: Reputation: Disabled
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.)
 
1 members found this post helpful.
Old 11-29-2018, 04:35 PM   #10
artax
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
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.
 
Old 11-29-2018, 04:36 PM   #11
artax
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by alexpaton View Post
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...
 
Old 11-29-2018, 04:37 PM   #12
artax
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fatmac View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blank screen regardless of distro or Live CD or live USB...newGateway Laptop :( why? wj76 Linux - Laptop and Netbook 30 05-28-2012 11:01 PM
USB Parttioning for making Live USB Distro vikrang Linux - Hardware 3 03-05-2011 06:45 PM
Live Distro and USB Falsh Drive combo - does a distro do this? carenza Linux - General 1 03-27-2009 10:33 AM
Live USB Distro with R/W skr Linux - Distributions 5 04-19-2007 03:38 PM
Mount usb devices suse 9.2 live Nawas111 SUSE / openSUSE 1 05-30-2005 08:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration