Persistence and Live Opensuse 12.3 USB

Hi,

I am trying to create a custom persistent Live OpenSUSE 12.3 USB system. Thanks to the SUSE studio service, I am able to create an iso of my custom system. I can easily create a live USB using the dd command, but I cannot find documentation/tutorial on how to make that system persistent. The section on persistent system in SDB:Live USB stick - openSUSE Wiki is very short and specific but seems out of context of everything I have seen/read. For instance, it says

To create a persistent file system on the usb stick give at the initial boot prompt the extra command

kiwi_hybridpersistent=yes

But I don’t have any initial boot prompt as everything is GUI based in my *iso. I don’t have any clue how to apply the recommendation.

Any idea where can I find a detailed step-by-step method to create a persistent USB system.

Thank you

Sebastien

On Mon, 08 Apr 2013 11:56:02 +0000, pomchip wrote:

> Any idea where can I find a detailed step-by-step method to create a
> persistent USB system.

With SUSE Studio, I would be inclined to use the USB Stick/Hard disk
image option instead of the ISO option. Then it’ll be persistent.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Hi Jim,

I have tried that but I wasn’t very successfully. After building a .iso (Live CD) and a .raw (USB Stick/Hard disk) file from the same appliance, the USB I got from the *.iso was bootable, the one I got from the *.raw file was not. In the latter case, the boot stopped at a “grub” shell.

For both attempts, I used fdisk and made sure that the partition was bootable.

Any idea?

On 2013-04-08 13:56, pomchip wrote:
> But I don’t have any initial boot prompt as everything is GUI based in
> my *iso. I don’t have any clue how to apply the recommendation.

I don’t know about susestudio, but in the standard openSUSE you do get a
place to type if you press ESC at the start of the boot, them I think it
is “e” for edit.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Press E at the boot menu to edit the kernel parameters. You want to add to the line starting with linux

OK, I will try (I don’t have the USB key with me right now).

On Mon, 08 Apr 2013 18:26:01 +0000, pomchip wrote:

> Hi Jim,
>
> I have tried that but I wasn’t very successfully. After building a .iso
> (Live CD) and a .raw (USB Stick/Hard disk) file from the same appliance,
> the USB I got from the *.iso was bootable, the one I got from the *.raw
> file was not. In the latter case, the boot stopped at a “grub” shell.
>
> For both attempts, I used fdisk and made sure that the partition was
> bootable.
>
> Any idea?

Did you follow the info at http://susestudio.com/help/use/disk-
image.html ?

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Hi Jim,

Yes I did, but the md5sum of the .raw image and the md5sum of /dev/sde are different. Some forum posts were indicating that this might be due to the difference in disk size… but I don’t know.

So I am not sure I was able to edit the kernel parameters, but when I have added kiwi_hybridpersistent=yes in the Boot options that can be defined in the Grub boot menu, the installation is modified so that the drives seen in Dolphine switch from:

CDROM | contains boot, config.isoclient, and OpenSUSE_12.3__KDE4-read-only-i686-002
Loop Device | all typical folders/files for a Linux system
CDROM | cannot access
97.7 GiB Hard Drive | cannot access // windows installation on my hard-drive

to

CDROM | contains boot, config.isoclient, and OpenSUSE_12.3__KDE4-read-only-i686-002
Loop Device | all typical folders/files for a Linux system
CDROM | cannot access
97.7 GiB Hard Drive | cannot access // windows installation on my hard-drive
CDROM | cannot access

However, the system does not store any files that I create once I reboot the system.

On Mon, 08 Apr 2013 22:46:08 +0000, pomchip wrote:

> Hi Jim,
>
> Yes I did, but the md5sum of the .raw image and the md5sum of /dev/sde
> are different. Some forum posts were indicating that this might be due
> to the difference in disk size… but I don’t know.

In theory, the disk size shouldn’t matter, but let’s have a look at the
output of “fdisk -l” (run as root, please use code tags (# button in the
advanced post editor)) and if the device shows a partition table (which
it should), maybe try running the md5sum against /dev/sdX1 (replacing “X”
with the drive identifier in question). That’ll limit it to the one
partition rather than the full device.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 2013-04-09 01:56, pomchip wrote:
> However, the system does not store any files that I create once I
> reboot the system.

Suggest you:

  1. Download the official live medium from download page, not a
    susestudio one.

  2. Attempt the same procedure on that image, see if you can write or
    not and it is persistent or not.

  3. If the procedure does not work, I suggest you open a bugzilla
    against “Live medium” component, and point to the wiki documentation
    that says to use kiwi_hybridpersistent. They have to either delete that
    documentation or repair the image or say how to do it now.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Hi Jim,

The following is the results of fdisk -l for my usb drive


Disk /dev/sde: 8054 MB, 8054636032 bytes
130 heads, 13 sectors/track, 9308 cylinders, total 15731711 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
Disk identifier: 0x7a5a5c42

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            2048     4956159     2477056   83  Linux

Regarding the md5sum, this are the results:

md5sum OpenSUSE_12.3__KDE4.i686-0.0.1.raw

4bf3ca40f9b64054da0197e09d12fb88 OpenSUSE_12.3__KDE4.i686-0.0.1.raw

md5sum /dev/sde1

2f9175cca48a92226d88cbad54231ba2 /dev/sde1

md5sum /dev/sde

7e1a9b644381a7091db816a5c41aa38a /dev/sde

Tried it on the official live CD, same results. I guess I will have to file a bug.

Thanks for the suggestions

On Tue, 09 Apr 2013 00:56:01 +0000, pomchip wrote:

> # md5sum OpenSUSE_12.3__KDE4.i686-0.0.1.raw
> 4bf3ca40f9b64054da0197e09d12fb88 OpenSUSE_12.3__KDE4.i686-0.0.1.raw #
> md5sum /dev/sde1 2f9175cca48a92226d88cbad54231ba2 /dev/sde1

These are the two that matter, and AFAIK they should match. How did you
write the image to the USB drive?

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I ran the following shell command as root:

dd if=/home/sebastien/Downloads/OpenSUSE_12.3__KDE4.i686-0.0.1.raw of=/dev/sdc bs=4k

Sebastien

BTW, I tried with 2 different USB drives with similar results.

On 2013-04-09 02:56, pomchip wrote:

> Regarding the md5sum, this are the results:
>
> # md5sum OpenSUSE_12.3__KDE4.i686-0.0.1.raw
> 4bf3ca40f9b64054da0197e09d12fb88 OpenSUSE_12.3__KDE4.i686-0.0.1.raw
> # md5sum /dev/sde1
> 2f9175cca48a92226d88cbad54231ba2 /dev/sde1
> # md5sum /dev/sde
> 7e1a9b644381a7091db816a5c41aa38a /dev/sde

The official checksums are these:


02f33a86ff8e89c415f59da2618f4930  openSUSE-12.3-DVD-x86_64.iso
fad87909023222943bb22cb74b9bef86  openSUSE-12.3-KDE-Live-x86_64.iso
2fb3b54715e3f3cdacd86bc0683a6db1  openSUSE-12.3-KDE-Live-i686.iso

So you see, it does not match your .raw file value. I don’t clearly know
where you obtain that raw file from, though.

Now I’ll obtain the checksum of my own usb stick (the 64bit DVD):


Telcontar:~ # time md5sum -b /dev/sde
34ea430dd0a821bc855dbc7085c0f1d6 */dev/sde

real    5m13.979s
user    0m17.849s
sys     0m5.138s
Telcontar:~ #

As you can see, it does not match the checksum of the DVD. This can be
because the size does not match; or perhaps, because it is rounded up to
a sector. However, the stick is fine, I have installed with it.

And no, the checksum of the two partitions in it would not match,
either, they are not the whole thing. Just think: the original iso file
contains a partition table; thus if you compare only a partition, the
rest is left out.

Now, I’ll extract the image out of the usb stick:


> minas-tirith:/home/cer # time dd if=/dev/sdb of=image_usb_stick bs=100M
> 73+1 records in
> 73+1 records out
> 7742685184 bytes (7,7 GB) copied, 370,082 s, 20,9 MB/s
>
> real    6m10.118s
> user    0m0.003s
> sys     0m36.329s
> minas-tirith:/home/cer # exit
> cer@minas-tirith:~> l Download/isos/openSUSE-12.3-DVD-x86_64.iso
> -rw-r--r-- 1 cer users 4691329024 Mar 13 15:45 Download/isos/openSUSE-12.3-DVD-x86_64.iso
> cer@minas-tirith:~> l image_usb_stick
> -rw-r--r-- 1 root root 7742685184 Apr  9 14:56 image_usb_stick
> cer@minas-tirith:~>

As you can see, the sizes do not match. The size of the stick image is,
of course, the entire USB size! (<8GB)

USB sticks have to be tested differently, but I don’t yet know how.

Let’s try - Look at this carefully:


> cer@minas-tirith:~> time dd if=image_usb_stick of=image_usb_stick_short bs=1M count=4474
> 4474+0 records in
> 4474+0 records out
> 4691329024 bytes (4,7 GB) copied, 184,497 s, 25,4 MB/s
>
> real    3m4.544s
> user    0m0.030s
> sys     0m21.419s
> cer@minas-tirith:~>
> cer@minas-tirith:~> l image_usb_stick_short
> -rw-r--r-- 1 cer users 4691329024 Apr  9 15:11 image_usb_stick_short
> cer@minas-tirith:~> cmp image_usb_stick_short Download/isos/openSUSE-12.3-DVD-x86_64.iso
> cer@minas-tirith:~>
> cer@minas-tirith:~> md5sum -b image_usb_stick_short
> 02f33a86ff8e89c415f59da2618f4930 *image_usb_stick_short
> cer@minas-tirith:~>


Do yo understand what I’m doing? I’m trimming the image obtained from
the usb stick to the exact same size as the iso image I downloaded. Then
I compare both, and they match to a byte. Finally I obtain the checksum,
and it also matches the official value.

So you see: the size is the culprit of the wrong checksum not matching
on usb sticks.

QED - Quod erat demonstrandum :wink:


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

First use this to make sure the USB device is completely clean:

dd if=/dev/zero of=/dev/sdX

where X is the alphabetic

Now use the dd command to write the raw image to the USB device, like you already did.

Next run

fdisk /dev/sdX

and make parition you installed to the active one

Next use the Yast partitioner to expand the size of the file-system.

Again next, run

resize2fs /dev/sdX#

where # is the number following the alphabetic

On 2013-04-09 17:06, Knurpht wrote:
> Code:
> --------------------
> fdisk /dev/sdX
> --------------------
> and make parition you installed to the active one

Warning. It is a GPT partition table, you can not use fdisk.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On Tue, 09 Apr 2013 13:38:15 +0000, Carlos E. R. wrote:

> So you see, it does not match your .raw file value. I don’t clearly know
> where you obtain that raw file from, though.

I was asking the OP about the checksums for the custom image he was
using, generated from SUSE Studio.

Obviously, comparing that to the official ISOs isn’t going to produce a
match.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C