[HOWTO] Live Mageia 3 on USB

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

[HOWTO] Live Mageia 3 on USB

Postby linuxero » Jul 2nd, '13, 18:28

Hi;

I like Mageia and I love to use it and make it known to people. Sometimes we have special requirements and for me it was to be able to boot both 32- and 64-bit Mageia from EXT4 partitions on a pen-drive.

It is not as easy and obvious as it might seem but it is not difficult either, so here is the way I did it:

First of all I modified the live initrd.gz so that my live Mageia boots from an EXT4 partition. If you are interested; you may download these initramfs from my personal web-site at:

This is outdated
http://mtailounie.net/progs/liveinit32 - (for 32-bit)
http://mtailounie.net/progs/liveinit64 - (for 64-bit)

Use the following link instead:
http://mtailounie.net/progs/mageialive.html (both 32 and 64 bit versions)

Step I:

Now I have a 16GB pen-drive. I decided to have the following partitioning scheme:

11GB NTFS-3G PRIMARY Partition Labelled USB_DATA - For use in both Windows and Linux
2GB EXT4 PRIMARY Partition Labelled MGA3X64 - For 64-bit Live Mageia
2GB EXT4 PRIMARY Partition Labelled MGA3X32 - For 32-bit Live Mageia
1GB SWAP PRIMARY Partition Labelled USB_SWAP - For live system swap

Step II:

I, then, downloaded the ISO's for the Mageia 3 Live KDE DVD's (32 and 64 bit versions)


Step III:

as root;

I mounted my MGA3X64, MGA3X32, 32-bit live ISO and 64-bit live ISO. - (Choose the mount points at your will)

Step IV:

I copied the contents of each ISO on the relative partition. (32-bit content onto MGA3X32 and 64-bit one onto MGA3X64)

Step V:

I copied the modified initramfs into the /boot folder on my USB partitions - (mga3init32 into MGA3X32/boot and mga3init64 into MGA3X64/boot)

Step VI:

I installed GRUB from my Mageia system onto my USB disk as follows:

Code: Select all
# grub-install --root-directory=/media/MGA3X64 /dev/sdf


Please note that your mount point might be different and most probably the identification of your pen-drive as well. My mount-point above is /media/MGA3X64 and my pen-drive is /dev/sdf.

Step VII:

I created my /media/MGA3X64/boot/grub/menu.lst as follows:
Code: Select all
timeout 27
color black/cyan yellow/cyan
gfxmenu (hd0,1)/boot/gfxmenu
default 0

title Mageia 3 Live 64-Bit
kernel (hd0,1)/boot/vmlinuz BOOT_IMAGE=linux root=mgalive:LABEL=MGA3X64 splash quiet rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 vga=788
initrd (hd0,1)/boot/mga3init64

title Mageia 3 Live 32-Bit
kernel (hd0,2)/boot/vmlinuz BOOT_IMAGE=linux root=mgalive:LABEL=MGA3X32 splash quiet rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 vga=788
initrd (hd0,2)/boot/mga3init32


PS. You might need to copy the gfxmenu from your installation into MGA3X64/boot/gfxmenu

Now I can boot my beloved Mageia USB. Please note that for my needs the Live EXT4 partitions are mounted rw..sorry folks. :)


Hope this be of use to others.
Last edited by linuxero on Feb 2nd, '14, 05:07, edited 2 times in total.
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50

Re: Live Mageia 3 on USB

Postby filip » Jul 3rd, '13, 09:17

Thanks linuxero.

Great and useful HowTo!

It would be nice if you add short explanation how and why you modified initrd.

I would also add Grub legacy to avoid some confusion ;).

What about moving this to The magician suggests...?
filip
 
Posts: 474
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia

Re: Live Mageia 3 on USB

Postby linuxero » Jul 3rd, '13, 16:52

filip wrote:It would be nice if you add short explanation how and why you modified initrd.

Actually I was trying to understand dracut and how does Mageia Live scripts work. Reading through the scripts I found out that at the end there is a script that is mounting the Live Medium. Unfortunately it has the file-system hard-coded when it mounts the medium. It could be easily modified to check the medium file-system and mount it accordingly.
So /sbin/mgalive-root should be modified to mount EXT4 file-system. No real magic into it :oops:

filip wrote:I would also add Grub legacy to avoid some confusion ;).

I agree and maybe I should have mentioned that I am doing this on a 64-bit Mageia 3 Installation as well :)

filip wrote:What about moving this to The magician suggests...?

I would be glad to read it there :oops: :)

Thanks for the follow-up.
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50

Re: [HOWTO] Live Mageia 3 on USB

Postby mackowiakp » Jul 6th, '13, 09:49

The question is about lifetime of such prepared USB memory stick. As I understand, swap partition is located on USB mem too. The USB stick can not be used as a normal HDD. The reason is that the USB mem withstand only a certain (small) number of read and write cycles. Read/write cycles on SWAP are very common, leading to rapid failure USB mem.
I had such a problem trying to use a USB mem as a drive to store temporary torrent files. I wanted to apply this solution to my server to keep "ordinary" HDD`a in spin-down state as long as possible. After 2 weeks, the USB mem was disposed of.
Similar situation with root partition. For example, because of the drift file ntp, logs, etc..
The solution I use in case of temporary torrent files is to use external SSD USB disk, instead USB mem. Such disk (having 16GB capacity too) is indeed more expensive then 16GB USB mem, but the lifetime is much, much larger.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: [HOWTO] Live Mageia 3 on USB

Postby linuxero » Jul 7th, '13, 17:54

My configuration is not for a daily use installation. On the other hand, I have been using a SWAP on USB for years now and it still works fine for me. Now I can't see why the live system should use the USB for write operations, other than the swap, since the root partition is in memory!

Thank you
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50

Re: [HOWTO] Live Mageia 3 on USB

Postby mackowiakp » Jul 7th, '13, 18:11

Depends on amount of memory. If memsize is enough big, system no swaps at all - so dont use frequently memstick
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: [HOWTO] Live Mageia 3 on USB

Postby papoteur » May 9th, '14, 17:46

Thanks linuxero for this method and for pointing out to me.
I think that this could be also on the wiki. But the generation of initrd fails. Can you expose of this can be built?
Papoteur.
papoteur
 
Posts: 93
Joined: Oct 27th, '11, 22:28

Re: [HOWTO] Live Mageia 3 on USB

Postby linuxero » May 9th, '14, 21:24

papoteur wrote:... .But the generation of initrd fails. Can you expose of this can be built?
Papoteur.


What do you mean by "the generation of initrd fails"? and "Can you expose of this can be built?"?

Sorry I couldn't understand! :oops:
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50

Re: [HOWTO] Live Mageia 3 on USB

Postby papoteur » Jun 4th, '14, 19:12

Linuxero,
I fail to see your answer. Sorry to be late.
As explained, initrd is like a black box, and we don't know how you created it. This is why I as asked you if you can detail this step to be reproductible by others.
You said
Actually I was trying to understand dracut and how does Mageia Live scripts work. Reading through the scripts I found out that at the end there is a script that is mounting the Live Medium. Unfortunately it has the file-system hard-coded when it mounts the medium. It could be easily modified to check the medium file-system and mount it accordingly.
So /sbin/mgalive-root should be modified to mount EXT4 file-system. No real magic into it :oops:

I'm not sure with that reproduce it.
papoteur
papoteur
 
Posts: 93
Joined: Oct 27th, '11, 22:28

Re: [HOWTO] Live Mageia 3 on USB

Postby doktor5000 » Jun 5th, '14, 00:52

papoteur wrote:As explained, initrd is like a black box, and we don't know how you created it.

Well, you can easily peek inside via lsinitrd - so it's not that much of a black box. After all it's only a gzip compressed archive of some files.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [HOWTO] Live Mageia 3 on USB

Postby papoteur » Jun 6th, '14, 22:34

Hello,
I've tried to apply the method.
I have done to partitions on a 8Gb stick.
The second is formated in ext4.
I mounted an iso fil in loop, then cp all the content in this second partition, and then gfxmenu and mga4init32.bin
I installed grub legacy and created boot/grub/menu.lst with the name of my partition in the entry.
At boot n the stick, I get grub with the entry. After Enter, lines show that it found the kernel. But then i get a kernal panic and :
XZ-compressed is corrupt
I have no idea why.
Papoteur
papoteur
 
Posts: 93
Joined: Oct 27th, '11, 22:28

Re: [HOWTO] Live Mageia 3 on USB

Postby papoteur » Jun 7th, '14, 21:14

md5 didn't match for mga4init32 and 64 I have downloaded.
papoteur
 
Posts: 93
Joined: Oct 27th, '11, 22:28

Re: [HOWTO] Live Mageia 3 on USB

Postby doktor5000 » Jun 7th, '14, 21:20

Match against what?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [HOWTO] Live Mageia 3 on USB

Postby papoteur » Jun 7th, '14, 22:19

At this site,
http://mtailounie.net/progs/mageialive.html
there is a file giving md5 sum for each file. The local md5 after downloding is not the same as in this file.
papoteur
 
Posts: 93
Joined: Oct 27th, '11, 22:28

Re: [HOWTO] Live Mageia 3 on USB

Postby doktor5000 » Jun 7th, '14, 22:43

You should ask the author of that page about that.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [HOWTO] Live Mageia 3 on USB

Postby Ken-Bergen » Jun 7th, '14, 22:54

If you download the tar.gz file and extract the files from that the md5sums do match.

As the Doktor said, contact the author about the discrepancies.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest

cron