Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

My adventures making a live USB

Off-Topic discussions about science, technology, and non Debian specific topics.
Message
Author
Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

My adventures making a live USB

#1 Post by Bulkley »

As I noted in another thread I was unable to create a live USB for the new MX Linux 17. Both Etcher and Gnome-Disks would do it but left off the live menu so I couldn't boot it. Unetbootin wouldn't even attempt it. dd wouldn't do it but that was probably just me not sorting the instructions and terrified of wiping my system. I found a list of live USB makers and tried several. One of them works! It is LiveUSB Install and is found here.

I have no idea why LiveUSB Install works and the others did not. The only hint is a note about syslinux but I have it and the live install completed properly anyway.

I'm posting this from within MX Linux 17 running live on my desktop. It is as pretty and functional as others have said. This is a nice distro. Stevepusser must be proud.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: My adventures making a live USB

#2 Post by Head_on_a_Stick »

Bulkley wrote:dd wouldn't do it but that was probably just me not sorting the instructions and terrified of wiping my system
Yeah, I try not to use `dd` for that exact reason.

My preferred method is:

Code: Select all

# cp example.iso /dev/sdX ; sync
Replace X with the letter assigned to the USB stick — plug the stick in and then run `dmesg|tail` to find this ;)
deadbang

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: My adventures making a live USB

#3 Post by Thorny »

dd is oldschool, and it works just fine with a hybrid ISO. I will grant you that it is not for clueless noobs, but actually neither is Debian.

Apparently it is also not for long time Debian users who don't understand how to use it properly or ex-Crunchbang users who have been here for a while. Please don't find this disrespectful, I don't mean it to be.

Maybe that's why Debian has so much choice.

Sorry, but today I am channeling dasein, who I wish was still here. :-)

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: My adventures making a live USB

#4 Post by GarryRicketson »

I keep these to options in my "notes", so I can all ways remember:

Code: Select all

   The following operands are available:

     if=file  Read input from file 

     of=file  Write output to file
===== additional notes=====
dd command, from remote disk to "home"
If your intent is to backup a remote computer's HDD A via SSH to a single file that's on your local computer's HDD, you could do one of the following.
Examples

run from remote computer

$ dd if=/dev/sda | gzip -1 - | ssh user@local dd of=image.gz

run from local computer

$ ssh user@remote "dd if=/dev/sda | gzip -1 -" | dd of=image.gz

Live example

$ ssh skinner "dd if=/dev/sda5 | gzip -1 -" | dd of=image.gz
208782+0 records in
208782+0 records out
106896384 bytes (107 MB) copied, 22.7608 seconds, 4.7 MB/s
116749+1 records in
116749+1 records out
59775805 bytes (60 MB) copied, 23.9154 s, 2.5 MB/s

$ ll | grep image.gz
-rw-rw-r--.   1 saml saml  59775805 May 31 01:03 image.gz

===============================================
genisoimage -v -J -r -V MY_DISK_LABEL -o /home/user/file.iso /home/user/for_iso

--------------------------
genisoimage -v -J -r -V   -o Server_Remote  /home/garry/test-server.iso   / 
-------------------
frome remote :** (VM) genisoimage   -allow-limited-size  -v -J -r -V   -o  /home/user/server-test.iso  /  
************Worked -sort of :   genisoimage   -allow-limited-size  -o  /home/user/server-test.iso  /      ****************
==================================================
https://wiki.debian.org/genisoimage 
------snip---- really long ....

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: My adventures making a live USB

#5 Post by Head_on_a_Stick »

Thorny wrote:Apparently it is also not for long time Debian users who don't understand how to use it properly or ex-Crunchbang users who have been here for a while
How dare you! :x

I never used #!, I went straight to Arch 'cos Waldorf's crusty old kernel didn't support my hardware :mrgreen:

Anyway, what sort of ****ing idiot would sit there typing out

Code: Select all

# dd if=example.iso of=/dev/sdb bs=4k
When `cp example.iso /dev/sdb` does exactly the same thing...

(Please don't find this disrespectful, I don't mean it to be.)
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: My adventures making a live USB

#6 Post by stevepusser »

Thanks for finding LiveUSBinstall. We'll check it out for MX.

I currently am doing the majority of packaging for MX, (but the MX app devs are doing their own packages now) plus some ideas can be traced back to me (I'm to blame for the default Featherpad text editor), but many others are contributing in major ways, including those with accounts here too. Anticapitalista and kmathern are a couple. Dolphin_oracle is building the ISOs, Adrian is doing monthly updates of the release, plus a lot more people to thank. Jerry3904 manages the whole project.

Currently, we hope to recruit a few more packagers. We've found out how to use pbuilder to cross-compile most packages without the virtual machine overhead.

PS I think there is some work underway to get Featherpad into Debian.
MX Linux packager and developer

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: My adventures making a live USB

#7 Post by Bulkley »

Thorny wrote:Sorry, but today I am channeling dasein, who I wish was still here. :-)
So do I.
Head_on_a_Stick wrote:My preferred method is:

Code: Select all

# cp example.iso /dev/sdX ; sync
Thanks, I'll try it.

stevepusser, Featherpad would be good in Debian.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: My adventures making a live USB

#8 Post by GarryRicketson »

H_O_A-S: Anyway, what sort of ****ing idiot would sit there typing out

Code: Select all
# dd if=example.iso of=/dev/sdb bs=4k
Me, but I never had much luck with cp working for iso and floppy images (I know, nobody uses them any more),... any way hope fully it works for Bulkley.
What I do is use 'dd' to write the image to the USB stick, after I check and assuming it works, boots ,etc. I do not try to make the "live system" persistent,
since it works, the last thing I want is for a possible mistake write something to it, and render it non bootable.
If I do need a directory that I can write to, etc,..or for example to copy output to. I resize the partition, shrink it to the minimum size, then create a new partition, preferably extended, or even just a dos partition, but one I can use to copy files to, etc,.... It is handy as well for installing packages ,or source code,...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: My adventures making a live USB

#9 Post by Head_on_a_Stick »

GarryRicketson wrote: Me, but I never had much luck with cp working
Both cp & dd use the exact same system calls to transfer the data (if bs=4k is applied to dd (for 4k disks)) so that doesn't make much sense.

The cp version is less complicated, easier to remember and quicker to type, what's not to like? :)
deadbang

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: My adventures making a live USB

#10 Post by sunrat »

Head_on_a_Stick wrote:Anyway, what sort of ****ing idiot would sit there typing out

Code: Select all

# dd if=example.iso of=/dev/sdb bs=4k
Not me. 4k would take forever! Here's the exact command I used:

Code: Select all

dd if=MX-17.RC1_x64.iso of=/dev/sdd bs=4M && sync
Works perfectly. ;)
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: My adventures making a live USB

#11 Post by Head_on_a_Stick »

sunrat wrote:4k would take forever!
Have you actually timed that?

4k is the standard sector size for hard drives these days so it should be the most efficient setting.
deadbang

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: My adventures making a live USB

#12 Post by GarryRicketson »

Oh, it is not that I don't like it, the first time I saw it mentioned, it seemed like the easiest thing to do, it just never worked out for me,... I have no idea why,
On the other side of the coin, after 'cp' did not work out, I tried 'dd' and all though slow, it worked perfect,... I do use 'cp' quite a bit for other tasks, like copying 'thisfile" to thatfile, or to another dir, ,,, etc... Any way, it is good both commands are available, so we have options.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: My adventures making a live USB

#13 Post by sunrat »

Head_on_a_Stick wrote:
sunrat wrote:4k would take forever!
Have you actually timed that?
Haha, of course not. I'm the kind of idiot who just unquestioningly followed advice from the Arch wiki - https://wiki.archlinux.org/index.php/US ... tion_media
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: My adventures making a live USB

#14 Post by Head_on_a_Stick »

^ I do love the ArchWiki but it is far from perfect and the upstream documentation should always be preferred.

Anyway, drum roll please, the results are in:

Code: Select all

alpine:~$ time sudo cp CorePlus-current.iso /dev/sdb
    0m41.97s real     0m00.00s user     0m00.22s system
alpine:~$ time sudo dd if=CorePlus-current.iso of=/dev/sdb
284672+0 records in
284672+0 records out
145752064 bytes (146 MB, 139 MiB) copied, 69.3507 s, 2.1 MB/s
    1m09.35s real     0m00.38s user     0m02.41s system
alpine:~$ time sudo dd if=CorePlus-current.iso of=/dev/sdb bs=4k 
35584+0 records in
35584+0 records out
145752064 bytes (146 MB, 139 MiB) copied, 42.5691 s, 3.4 MB/s
    0m42.57s real     0m00.01s user     0m00.26s system
alpine:~$ time sudo dd if=CorePlus-current.iso of=/dev/sdb bs=4M 
34+1 records in
34+1 records out
145752064 bytes (146 MB, 139 MiB) copied, 43.6011 s, 3.3 MB/s
    0m43.60s real     0m00.00s user     0m00.27s system
alpine:~$
So cp is (roughly) the same as dd+bs=4k, which is ever so slightly faster than bs=4M, which are all quite a bit faster than plain dd.

@OP: how does your GUI perform against the stopwatch?
deadbang

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: My adventures making a live USB

#15 Post by sunrat »

Nice work @Head_on_a_Stick. Really the differences are insignificant apart from poor old plain dd.

Another thought - when specifying BS, does it map transfers exactly to hardware blocks? Obviously it can't with BS=512B or 4M if hardware blocks are 4k.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: My adventures making a live USB

#16 Post by Head_on_a_Stick »

sunrat wrote:when specifying BS, does it map transfers exactly to hardware blocks? Obviously it can't with BS=512B or 4M if hardware blocks are 4k.
Well, I can't claim to know the technical details but it does seem that a bs setting that is not an exact multiple of the sector size on the disk would cause some transfer inefficiencies.

The beauty of the cp method is that sort of detail is left to the kernel, which I'm pretty sure knows better than me :)
deadbang

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: My adventures making a live USB

#17 Post by dotlj »

I have used cat example.iso > /dev/sdx for many years, much like using cp and it's never failed. I have used dd but for install images, you can't go wrong with cat.

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: My adventures making a live USB

#18 Post by Bulkley »

sunrat wrote:Here's the exact command I used:

Code: Select all

dd if=MX-17.RC1_x64.iso of=/dev/sdd bs=4M && sync
Works perfectly.
When I run

Code: Select all

dd if=MX-17_x64.iso of=/dev/sdb bs=4M && sync
what I get is a beautiful antiXlive USB with antiX, boot and EFI directories plus cdrom.ico and version. It looks great! tUnfortunately it is not recognized by either of my computers and won't boot.

For the record, my desktop runs Debian Stretch with openbox and my laptop runs Devuan Jessie. Both machines are more than eight years old.

Edit: I changed the laptop BIOS from UEFI to Legacy and it booted the MX live USB. Why does that help?

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: My adventures making a live USB

#19 Post by Thorny »

Head_on_a_Stick wrote:How dare you! :x

Chuckle! I dare because I am an old guy and don't care what anyone thinks of me. I am retired and past caring about my rep as it won't affect my income or my ability to enjoy my life on the downhill slope. ;-)
Head_on_a_Stick wrote:I never used #!, I went straight to Arch 'cos Waldorf's crusty old kernel didn't support my hardware :mrgreen:
I'm sorry for offending you. That explains why I don't remember you from #! forums, I had an install for a while but I always liked real Debian better. It was nice that the developer actually responded to posts sometimes and that is also one of the strengths of MX, developers take part and that may even be one of the reasons that it is so polished.
Head_on_a_Stick wrote:Anyway, what sort of ****ing idiot would sit there typing out

Code: Select all

# dd if=example.iso of=/dev/sdb bs=4k
When `cp example.iso /dev/sdb` does exactly the same thing...
Well, I can't speak for all the ****ing idiots out here but I probably do it from habit, when I find something that works I tend to keep using it. The older I get the more I dislike change.
Head_on_a_Stick wrote:(Please don't find this disrespectful, I don't mean it to be.)
I don't at all, I like for people to speak(write) their minds plainly. One of the good things about DUF is that the Moderation is not heavy handed. In my opinion, it is much more like the real world than the forums for that OS that should not be named. ;-)
BTW, I truly meant that comment.

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: My adventures making a live USB

#20 Post by Thorny »

Bulkley wrote: When I run

Code: Select all

dd if=MX-17_x64.iso of=/dev/sdb bs=4M && sync
what I get is a beautiful antiXlive USB with antiX, boot and EFI directories plus cdrom.ico and version. It looks great! tUnfortunately it is not recognized by either of my computers and won't boot.
After I shot my mouth off yesterday, I decided I'd better check to make sure. So I dd'd the ISO I had to a 2G stick and when finished I took it to my netbook and booted it up to that stunning MX desktop.

I used MX-17_January_x64.iso, is that the same version you used?
Bulkley wrote:Edit: I changed the laptop BIOS from UEFI to Legacy and it booted the MX live USB. Why does that help?
Maybe stevo can answer that, if he choses to, I am not familiar with UEFI although I've seen quite a few posts about early UEFI on older machines that are not standards compliant.

Post Reply