Rootserver Sponsor

webtropia"

Donations

Please support your operating system's further development:

donate"

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ugoOffline
15 Post subject: usb install with iso and persistent area on two partitions  PostPosted: 21.07.2011, 16:42



Joined: 2011-03-21
Posts: 11
Location: Italy
Status: Offline
Hi everybody,
I've just made a persistent install on my usb stick with the i386 kde-lite version of Imera. Everything seems fine enough to me.

My request is in the subject. You could answer "why?!".
Let's say: taking iso and a persistent aptosid-rw file in the same vfat partition, it can occur (if the shutdown is not properly done, for instance because your laptop used all the batteries power) that such rw file is "broken" at your next reboot (with students, this occurs many times!).
Taking iso and the persistent area on a ext* partition is very fine, but that first partition on your usb-stick will not be available on a windows PC unless ...
Thus, installing the iso on the first vfat partition of an usb-stick and using a second ext* partition for persistency would be nearly perfect.

Is it possible?

Is there a simple way to write down a script that automatically modify the grub booting file, so to adapt it to the needs I've just described?


Thanks a lot for your help,
Ugo
 
 View user's profile Send private message  
Reply with quote Back to top
ugoOffline
Post subject:   PostPosted: 21.07.2011, 16:44



Joined: 2011-03-21
Posts: 11
Location: Italy
Status: Offline
Sorry, I posted it in the wrong forum. I would post it in the installation forum. Please, can somebody of you to move it in a suitable place?
 
 View user's profile Send private message  
Reply with quote Back to top
bfreeOffline
Post subject:   PostPosted: 21.07.2011, 17:07
Team Member


Joined: 2010-08-26
Posts: 267

Status: Offline
If I understand correctly the easy answer is to just use the first fat partition for boot and put the rest in the ext partition. As things stand the persist data must be in the same place as the squashfs (which may be hidden inside the iso), but the boot can be anywhere.

There are lots of ways to do this, one thing I will say though is that I've had windows make a total mess of an external usb disk which had the first partition fat and a second partition ext3 (this was a year or two ago), it seemed windows decided that the fat partition must obviously take up the whole disk. I never bothered debugging or reproducing this though as I didn't care, but you have been warned!

It's probably easiest to do this using syslinux, though you could use the usb installer and then modify things similarly to get to the same point.

Using syslinux you could just copy the /boot directory from the iso onto the fat partition and then make it bootable as described in the release notes and Booting aptosid blog post. Then put the iso contents into the second extN partition (you can leave out /boot). Now when syslinux starts it will automagically add fromhd and this will mean it should find the system from the second partition after it has booted from the first one. You could edit up your syslinux.cfg to specify the UUID of that second partiton if you wanted, or instead just put the iso in the second partition and add (if the iso is called a.iso) fromiso=/a.iso. Likewise you could add an extra menu for "persist", either as teh default or as a second option (I would leave an option without persist though to use if the persist breaks).

In fact you could ignore the first fat partition completely and just use extlinux instead and have everything in the extN partition. The advantage of putting /boot in the fat partition is you can edit the boot options from $OtherOS. The only problem with this approach could be with stupid BIOS which insist on only booting from usb if the first partition is bootable (I've no idea if these exist, but I wouldn't be surprised).
 
 View user's profile Send private message  
Reply with quote Back to top
ugoOffline
Post subject:   PostPosted: 28.07.2011, 21:41



Joined: 2011-03-21
Posts: 11
Location: Italy
Status: Offline
Dear bfree,
just to say that I tried to follow your suggestions and it works!

Moreover, I think that the procedure can be easily made (nearly) automatic by a suitable script, that also add to the ext* partition on the usb stick all the additional packages my students need. I have time to make other tests, but this solution can be very useful to me and to my students!

Many thanx,
Ugo
 
 View user's profile Send private message  
Reply with quote Back to top
ugoOffline
Post subject:   PostPosted: 08.01.2012, 16:30



Joined: 2011-03-21
Posts: 11
Location: Italy
Status: Offline
Hi everybody,
I tried to redo the same for Ponos and it doesn't work.

More precisely, same two partitions on the (same) usb stick. I copied the boot directory of ponos on the first one (vfat). I copied the iso image of ponos on the second one (ext*).
I edited the syslinux.cfg (on the first partition) by specifying the UUID of the second partition.
Each time I boot my laptop from the usb stick, I see the entry menu handled by syslinux and the linux kernel can be loaded (that's fine), but the procedure hangs after having probed (several times) the second partition. Apparently, it doesn't detect the iso image of ponos.
Removing the UUID doesn't change much, it probes all the available partitions (including those on the HD) and after that it hangs again.

Am I wrong? Where?
Is the structure of aptosid ponos so different with respect to imera that syslinux can't boot from a different partition?

Many thanks for your help.
Ugo
 
 View user's profile Send private message  
Reply with quote Back to top
bfreeOffline
Post subject:   PostPosted: 08.01.2012, 18:05
Team Member


Joined: 2010-08-26
Posts: 267

Status: Offline
Did you forget to set "fromiso" (sounds like you have the iso on the second partition)? Maybe last time you didn't put the iso on the second partition but instead put the contents of the iso on the second partition.
 
 View user's profile Send private message  
Reply with quote Back to top
ugoOffline
Post subject:   PostPosted: 08.01.2012, 18:59



Joined: 2011-03-21
Posts: 11
Location: Italy
Status: Offline
What a stupid man!
I really forgot to add the "fromiso" cheatcode.
I guess I copied and pasted in an uncomplete way (from the syslinux.cfg file I used for Imera); after that, I didn't recognize my mistake, because in those two files there were so long lines that the part with/without "fromiso" was hidden.

I apologize.

I think I'll make a little more automatic the procedure, so to let my students install ponos plus the software we need for our spring course. Thus, this kind of installation on two different partitions on a usb stick will be widely tested!

Many thanks,
Ugo
 
 View user's profile Send private message  
Reply with quote Back to top
ugoOffline
Post subject:   PostPosted: 31.01.2012, 12:09



Joined: 2011-03-21
Posts: 11
Location: Italy
Status: Offline
Hi everybody,
I did the same procedure with two (2!) usb sticks of two students of mines. It seems to me that their usb sticks are in the same state of mine (which works without any problem).

Unfortunately, when I boot from each of those sticks, just after having detected the aptosid.iso file on the second (ext2) partition, the booting procedure hangs. The most relevant last messages are (in my opinion):
Reusing persistent data on disk/by-uuid/97.....
Mounting aufs union filesystem...mount:mounting aufs on /root/fll/aufs failed: Invalid argument
Failed to prepare aufs union filesystem

And after a few more lines of messages, it stops.

Do you know what is going on?

Thanx for your help,
Ugo
 
 View user's profile Send private message  
Reply with quote Back to top
bfreeOffline
Post subject:   PostPosted: 31.01.2012, 12:29
Team Member


Joined: 2010-08-26
Posts: 267

Status: Offline
Pretty impossible to guess from this what is going on. You could have a look at the persistent data directory and to try and see if there is anything obviously wrong. You could also try an fsck on the ext partition and maybe double check the partition tables (and that the uuid given for "reusing persistent data" is the right one.
 
 View user's profile Send private message  
Reply with quote Back to top
ugoOffline
Post subject:   PostPosted: 03.02.2012, 22:25



Joined: 2011-03-21
Posts: 11
Location: Italy
Status: Offline
Dear bfree,
thanks for your quick reply.

The present answer is just to say that yesterday, I've calmly redone everything and it worked for both the (2!) usb sticks.

I really don't know where I was wrong. The only real change is that the last time I started from erasing the MBR of the usb stick with the command
dd if=/dev/zero of=/dev/sdc bs=512 count=1
then I recreated the partition table of the sticks with gparted and all the rest has been the same as in the previous trials.

Now, I think it is safer to make my (future) procedure automatic so to include at the very beginning also the dd coomand erasing the MBR.

Let me apologize, even if I don't really understand the reasons of my fault.

Ciao,
Ugo
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio