dd for a live distro

Will the

dd if=<file-name> of=/dev/sdx bs=4m

write a live distro iso that will boot into the ‘live’ Linux on a UEFI unit?

Yes, that should be fine.

Just be sure that you use the raw device – “/dev/sdx” rather than “/dev/sdx1”. And, of course, you will have to check what ‘x’ should be. For that, I normally use:

ls -ltr /dev/sd?

and the last line should be for the USB most recently plugged in (probably the one that you want to use).

Thanks nrickert,
I just didn’t know if something needed to be changed for a live version. And the web searches and the help for dd didn’t answer that specifically.

I completely forgot to ask about making it have persistence.
It is not mounted, and the partition tools won’t let me add a persistence partition.
Looks like back to Windows and try to find a way to make it legacy/UEFI bootable w/persistence.
Bummer

It’s the same for live and for DVD installers.

That should be automatic with the live media.

I’m not sure about that, myself. On a DVD or CD which cannot be written and rewritten to, of course, it can’t be, not automatically, since persistence savings would have to be manually configured, I think.

Although a USB can be rewritten to, maybe there is something that first needs to be done to set it up?

It doesn’t happen by magic. But, as far as I know, whatever is needed is already built into the live media.

Perhaps you have to add “kiwi_hybridpersistent=true” to the boot command line, though that’s not my experience.

Yes, from time to time this has been broken. However, I’ve seen a report on these forums within the last month that suggests it is currently working.

Looking into the file structure for the ‘live’ version on the USB created with ‘dd’ , there is a casper directory, but I don’t see any indication that there is actually a casper-rw file(the persistence read/write file if I understand things correctly).

Actually I would like to make it bootable either legacy or UEFI, and use the remaining larger portion of the USB as the ‘casper-rw’ area. This would be for my wife to get used to a Linux(without install) and also let me use it on my desktop if I want or need to until it’s life cycle runs it’s course.

I know there are plenty of articles on the web about doing that, but I don’t find any that mention MBR and UEFI in the set up.

I am not sure a UEFI system will boot from a ‘live’ system on a fat32 partition.

As it stands now, the USB stick written via the '‘dd’ command does not save changes.

fdisk -l for the usb stick
**Disk /dev/sdd: 14.5 GiB, 15513354240 bytes, 30299520 sectors**
Units: sectors of 1 * 512 = 512 bytes                                                                                           
Sector size (logical/physical): 512 bytes / 512 bytes                                                                           
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                               
Disklabel type: dos                                                                                                             
Disk identifier: 0x7da654e6                                                                                                     
                                                                                                                                
**Device****Boot****  Start****    End****Sectors**** Size****Id****Type**
/dev/sdd1  *          0 3710015 3710016  1.8G  0 Empty                                                                          
/dev/sdd2       3699676 3704347    4672  2.3M ef EFI (FAT-12/16/32)

BTW, /dev/sdd1 is not empty. It does boot to the live Linux.

Gparted screenshot
http://paste.opensuse.org/5195623

FOOTNOTE:
If there were a live version of Leap, I would be working with it!

There is…
https://download.opensuse.org/distribution/leap/15.0/live/

I’m not familiar with “Casper” in this context.

When you successfully boot your USB, it should create an addition partition (partition 3 on your USB). And that’s for persistent data. The file system for that partition has a label “hybrid”.

Actually I would like to make it bootable either legacy or UEFI, and use the remaining larger portion of the USB as the ‘casper-rw’ area.

It should already be bootable either legacy or UEFI.

In a recent blog post, I showed images of the boot screen for both legacy booting and UEFI booting. Those were for the DVD installer. The live media boot screens are a little different but similar enough.

I decided to go ahead and do some testing.

I used the live KDE for Leap 15.0 – “openSUSE-Leap-15.0-KDE-Live-x86_64-Snapshot17.9-Media.iso”

I made a “dd” copy of that to “/dev/sdd” (where my USB shows up). I used a 4G USB.

After preparing the USB, I did “fdisk” to show the partitioning:


fdisk -l /dev/sdd
Disk /dev/sdd: 3.7 GiB, 4004511744 bytes, 7821312 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6494d48d

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdd1  *         64 1728511 1728448  844M 17 Hidden HPFS/NTFS
/dev/sdd2       1728512 1759231   30720   15M ef EFI (FAT-12/16/32)

As you can see, it has two partitions.

I then booted it on a UEFI box. And it booted up fine. While it was running, I used “fdisk” to recheck and it now had three partitions. The third partition is the “hybrid” partition for persistent storage.

I opened “konsole”, and configured it to my preferences – scroll bar on the left, “black on random light” for appearance.

I then shutdown that computer (actually, rebooted to a system on the hard drive).

I then plugged the same USB into an older legacy computer. And I booted that to the USB. It came up nicely. When I ran “konsole” the scroll bar was on the left where I had put it, and colors were from black on random light. So that configuration had been kept on the persistent storage.

And here’s the final “fdisk” output:


fdisk -l /dev/sdd
Disk /dev/sdd: 3.7 GiB, 4004511744 bytes, 7821312 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6494d48d

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdd1  *         64 1728511 1728448  844M 17 Hidden HPFS/NTFS
/dev/sdd2       1728512 1759231   30720   15M ef EFI (FAT-12/16/32)
/dev/sdd3       1759232 7821311 6062080  2.9G 83 Linux

That final partition (2.9G) is for persistent storage. This was a 4G USB. With a larger USB you would get a larger “hybrid” partition for persistent storage.

I did not have to take any extra steps to get that persistent storage. It was automatic – setup the first time that USB stick was booted.

I hope that helps.

IIRC there is a casper directory that holds a vmlinux among other things. (Screen shots below)
If there were a ‘persistence/persistent’ file it would be labeled casper-rw
Near as I can explain it, (and remember) when I did it from a Windows USB creation tool, the casper-rw was a result of setting the ‘persistence’ value in the tool options and it created a casper-rw file, not a directory for the saves.

What is shown in the codes i posted above are after a successful boot.

I booted the USB on my MBR desktop. I have yet to try on one of the UEFI laptops, but when it was a Windows application write to the USB it did not boot on the UEFI machine.

casper screenshot off the USB stick
Directory
http://paste.opensuse.org/67459652
Directory contents
http://paste.opensuse.org/96787642

OK! Thanks!
I searched, but didn’t come up with a Leap live version site. Now I have one.
Time to start things all over with something I actually like instead of settling for something else… With nrickerts information it will hopefully put me in front of the curve, not behind as i seem to be all the time.

I am sure it will!
You went way out of the way or this and I thank you!
I just don’t understand when I booted it in my MRB machine, it did not create the third partition.
Or maybe it has to be booted UEFI first to do that.

Anyway, a lot of information to absorb and again THANK YOU!

You’re too hard on yourself. I admire your drive with learning. You have our support Bill. I believe it serves to encourage others to try new things as well.:slight_smile:

I don’t want to add to the noise, but I noticed a possible misunderstanding in the thread, since Neil (nrickert) is referring to the LEAP media in his instructions, while some screenshots posted by Bill_L show a Mint media.
Please Bill, be aware that LEAP media (live or installer) have features of their own and AFAIK other distros behave differently, notably Mint and Debian derivatives. So you may be correct about Casper etc. but that is not the way LEAP media behave.
So AFAIK nrickert guides strictly apply ONLY to openSUSE media; with other distros YMMV.
(Please Bill don’t take the above as a slap on your head: that is almost impossible to know unless you are a seasoned openSUSE user :wink: )

I look at it the other way. Bill_L is teaching me. I did not know about that “Casper” directory. So I took a look at my iso for ubuntu 18.04, and there it was.

The added ‘noise’ is helpful. Good to know each species has its own little quirks.
Anyway, I am starting over with an Leap 15 live version, and using nrickert’s notes.

BTW, no slap felt. Maybe a whiff of air as I ducked…LOL just kidding.