32 bit and 64 bit Porteus on the same USB drive ?

Post here if you are a new Porteus member and you're looking for some help.
komoornik
White ninja
White ninja
Posts: 16
Joined: 24 Feb 2011, 19:50
Location: Poland

32 bit and 64 bit Porteus on the same USB drive ?

Post#1 by komoornik » 24 Jul 2011, 16:24

Yeah, but with two different partitions.

I got 4 GB USB Drive formatted with: 1.8 GB Fat and 1.8 GB ext2.

Is it possible to get two versions running ?

I tried to do it like in the faq, so i've put boot folder in fat partition and 32 + 64 folders in ext2 partition. 32 and 64 folder also contain boot and porteus folders.


With that porteus.cfg, when i press first options it starts to count from 3 and then again and again. With any other option it just do nothing:

Code: Select all

PROMPT 0
TIMEOUT 30
DEFAULT /boot/syslinux/vesamenu.c32
MENU BACKGROUND /boot/porteus.jpg
MENU TITLE Porteus-v1.0

MENU WIDTH 50
MENU MARGIN 2
MENU ROWS 13
MENU HELPMSGROW 17
MENU TIMEOUTROW 28
MENU TABMSGROW 15
MENU CMDLINEROW 22
MENU HSHIFT 4
MENU VSHIFT 5

	menu color screen	37;40      #00000000 #00000000 none
	menu color border	30;44      #00000000 #00000000 none
	menu color title	1;36;44    #ffF6FF00 #30003f07 none
	menu color unsel	37;44      #ffffffff #00000000 none
	menu color hotkey	1;37;44    #ff8037b7 #00000000 none
	menu color sel		7;37;40    #ff111B78 #003f7fbf none
	menu color hotsel	1;7;37;40  #ffaf67f7 #003f7fbf none
	menu color scrollbar	30;44      #00000000 #00000000 none

	menu color tabmsg	31;40      #ffB6F538 #00000000 none
	menu color cmdmark	1;36;40    #ffff0000 #00000000 none
	menu color cmdline	37;40      #ffffffff #ff000000 none
	menu color pwdborder	30;47      #ffff0000 #00000000 std
	menu color pwdheader	31;47      #ffff0000 #00000000 std
	menu color pwdentry	30;47      #ffff0000 #00000000 std
	menu color timeout_msg	37;40      #ff809aef #00000000 none
	menu color timeout	1;37;40    #ffb72f9f #00000000 none
	menu color help		37;40      #ffD5F538 #00000000 none
	menu color msg07	37;40      #90ffffff #00000000 std


#32-bit entries

LABEL xconf
MENU LABEL 32 bit KDE
KERNEL /32/boot/vmlinuz
APPEND initrd=/32/boot/initrd.xz from_dir=32 vga=791 autoexec=xconf;telinit~4 changes=/32/porteus/ toroot
TEXT HELP
    Run 32 bit Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT

LABEL lxde
MENU LABEL 32 bit LXDE
KERNEL /32/boot/vmlinuz
APPEND initrd=/32/boot/initrd.xz from_dir=32 vga=791 lxde autoexec=xconf;telinit~4 changes=/32/porteus/ to root
TEXT HELP
    Run 32 bit Porteus the same as above.
    Lightweight LXDE to be
    launched as default desktop
ENDTEXT

LABEL fresh
MENU LABEL 32 bit Always Fresh
KERNEL /32/boot/vmlinuz
APPEND initrd=/32/boot/initrd.xz from_dir=32 nomagic autoexec=xconf;telinit~4 toroot
TEXT HELP
    Normally 32 bit Porteus saves all changes
    to the /porteus/changes/ directory
    on the boot media (if writable)
    and restores them next boot.
    Use this option to start a fresh
    system, changes are not read from
    or written to any device
ENDTEXT

LABEL cp2ram
MENU LABEL 32 bit Copy To RAM
KERNEL /32/boot/vmlinuz
APPEND initrd=/32/boot/initrd.xz from_dir=32 vga=791 copy2ram autoexec=xconf;telinit~4 toroot
TEXT HELP
    Run 32 bit Porteus the same as above,
    but first copy all data to RAM
    to get a huge speed increase 
    (needs >300MB)
ENDTEXT

LABEL startx
MENU LABEL 32 bit Graphics VESA mode
KERNEL /32/boot/vmlinuz
APPEND initrd=/boot/initrd.xz from_dir=32 autoexec=telinit~4 changes=/32/porteus/ toroot
TEXT HELP
    Run 32 bit Porteus with KDE, but skip
    the graphics card autoconfig.
    This forces 1024x768 resolution
    using a standard VESA driver
ENDTEXT

LABEL text
MENU LABEL 32 bit Text mode
KERNEL /32/boot/vmlinuz
APPEND initrd=/32/boot/initrd.xz from_dir=32 toroot
TEXT HELP
    Run 32 bit Porteus in text mode and 
    start the command prompt only
ENDTEXT

LABEL pxe
MENU LABEL 32 bit Porteus as PXE
KERNEL /32/boot/vmlinuz
APPEND initrd=/32/boot/initrd.xz from_dir=32 autoexec=pxe-boot;xconf;telinit~4 toroot
TEXT HELP
    Run 32 bit Porteus as usual, but also
    initialize a PXE server.
    This will allow you to boot Porteus
    on other computers over a network
ENDTEXT

MENU SEPARATOR

#64-bit entries

LABEL xconf
MENU LABEL 64 bit KDE
KERNEL /64/boot/vmlinuz
APPEND initrd=/64/boot/initrd.xz from_dir=64 vga=791 autoexec=xconf;telinit~4 changes=/64/porteus/ toroot
TEXT HELP
    Run 64 bit Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT

LABEL lxde
MENU LABEL 64 bit LXDE
KERNEL /64/boot/vmlinuz
APPEND initrd=/64/boot/initrd.xz from_dir=64 vga=791 lxde autoexec=xconf;telinit~4 changes=/64/porteus/ to root
TEXT HELP
    Run 64 bit Porteus the same as above.
    Lightweight LXDE to be
    launched as default desktop
ENDTEXT

LABEL fresh
MENU LABEL 64 bit Always Fresh
KERNEL /64/boot/vmlinuz
APPEND initrd=/64/boot/initrd.xz from_dir=64 nomagic autoexec=xconf;telinit~4 toroot
TEXT HELP
    Normally 64 bit Porteus saves all changes
    to the /porteus/changes/ directory
    on the boot media (if writable)
    and restores them next boot.
    Use this option to start a fresh
    system, changes are not read from
    or written to any device
ENDTEXT

LABEL cp2ram
MENU LABEL 64 bit Copy To RAM
KERNEL /64/boot/vmlinuz
APPEND initrd=/64/boot/initrd.xz from_dir=64 vga=791 copy2ram autoexec=xconf;telinit~4 toroot
TEXT HELP
    Run 64 bit Porteus the same as above,
    but first copy all data to RAM
    to get a huge speed increase 
    (needs >300MB)
ENDTEXT

LABEL startx
MENU LABEL 64 bit Graphics VESA mode
KERNEL /64/boot/vmlinuz
APPEND initrd=/64/boot/initrd.xz from_dir=64 autoexec=telinit~4 changes=/64/porteus/ toroot
TEXT HELP
    Run 64 bit Porteus with KDE, but skip
    the graphics card autoconfig.
    This forces 1024x768 resolution
    using a standard VESA driver
ENDTEXT

LABEL text
MENU LABEL 64 bit Text mode
KERNEL /64/boot/vmlinuz
APPEND initrd=/64/boot/initrd.xz from_dir=64 toroot
TEXT HELP
    Run 64 bit Porteus in text mode and 
    start the command prompt only
ENDTEXT

LABEL pxe
MENU LABEL 64 bit Porteus as PXE server
KERNEL /64/boot/vmlinuz
APPEND initrd=/64/boot/initrd.xz from_dir=64 autoexec=pxe-boot;xconf;telinit~4 toroot
TEXT HELP
    Run 64 bit Porteus as usual, but also
    initialize a PXE server.
    This will allow you to boot Porteus
    on other computers over a network
ENDTEXT


MENU SEPARATOR

LABEL plop
MENU LABEL PLoP BootManager
KERNEL /boot/syslinux/plpbt
TEXT HELP
    Run the plop boot manager.
    This utility provides handy 
    boot-USB options for machines 
    with vintage/defective BIOS
ENDTEXT

LABEL memtest86
MENU LABEL Run Memtest utility
KERNEL /boot/tools/mt86p
TEXT HELP
    Don't start Porteus at all, but
    rather run the MemTest utility
    to diagnose your computer's RAM
    for possible errors
ENDTEXT

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#2 by fanthom » 24 Jul 2011, 17:39

hello,

i would do it this way:
1) extract /boot and /porteus from 32bit ISO in first partition (FAT) and /porteus only on second partition (ext2).
2) copy 64bit vmlinuz and initrd.xz to /boot on first partition and save as vmlinuz-64 and initrd-64.xz
3) edit your porteus.cfg and add entry for 64bit system, example:

Code: Select all

LABEL xconf
MENU LABEL 64 bit KDE
KERNEL /boot/vmlinuz-64
APPEND initrd=/boot/initrd-64.xz from_dev=/dev/sdb2 vga=791 autoexec=xconf;telinit~4 changes=/mnt/sdb2/porteus/ toroot
TEXT HELP
    Run 64 bit Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT
in this example i have used 'from_dev=/dev/sdb2' cheatcode which tells linuxrc to boot from second partition (64bit porteus) and not the first one (32bit).
more reliable way would be:
a) use 'from_dev=UUID:uuid_of_second_partition'
b) rename /porteus/porteus-v1.0.sgn to /porteus/porteus-v1.0-64.sgn on second partition and use 'sgnfile=porteus-v1.0-64.sgn' cheatcode instead of 'from_dev='

good luck!
Please add [Solved] to your thread title if the solution was found.

komoornik
White ninja
White ninja
Posts: 16
Joined: 24 Feb 2011, 19:50
Location: Poland

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#3 by komoornik » 24 Jul 2011, 17:52

Hmm.

Only one porteus on second partition ? Like the 32 bit version one?

So 64 bit would be just 32 bit with other kernel ?

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#4 by Hamza » 24 Jul 2011, 18:08

Another thing,

To make sure that your "changes" will not be broken (recommended), you need to make a .dat container for the Porteus on the FAT partition.

For this action,
You have a great tool named "Porteus save.dat Manager" on each version of Porteus.
If you need more information : Click Here
After this, you must set your boot configuration to use it instead default changes folder.

You just need to replace the "changes=/porteus/" by "changes=/mnt/sdXN/name_of_dat_file.dat"

You need to replace the "X" and "N" by the letter and number of your device.
I think that "X" is for the device and "N" is for the partition
An example : /mnt/sdc1
Here, the "C" is for the device and "1" is for the partiton (Here, the first partiton of the device "C")


Regards,
Hamza
NjVFQzY2Rg==

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#5 by fanthom » 24 Jul 2011, 19:46

@komornik
"So 64 bit would be just 32 bit with other kernel ?"
sorry for being not clear - i meant:

Code: Select all

1) extract /boot and /porteus from 32bit ISO on first partition (FAT) and /porteus only from 64bit ISO on second partition (ext2).
32bit resides on FAT and 64bit on ext2.
Please add [Solved] to your thread title if the solution was found.

komoornik
White ninja
White ninja
Posts: 16
Joined: 24 Feb 2011, 19:50
Location: Poland

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#6 by komoornik » 24 Jul 2011, 20:11

This means that i would have to use this whole dat container, which i don't like.

The reason i wanted 64 bit was mainly becasue of that:
http://porteus.org/forum/viewtopic.php?f=41&t=709

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#7 by Ahau » 25 Jul 2011, 02:58

In my opinion, all you needed was to set everything up the way you had it in your first post (one /boot/ in /dev/sdb1, and then /boot and /porteus for their respective edition inside /32 and /64 on/dev/sdb2, and then add 'from_dev=/dev/sdb2 (or use the UUID as fanthom suggests if you are going to use this on machines with different setups, as your device could then be sdc or sdd instead od sdb).

You don't need to put one on FAT and one on EXT2. Even if you had one on FAT, you could still save the changes for it on the EXT partition, with changes=/dev/sdb2/32bitchanges/, or however you want to set that up. The possibilities are endless --

Again, I think your only issue with your first setup was leaving out from_dev=.

Posted after 9 minutes 11 seconds:
Two more notes -

first, make sure that the porteus.cfg you are editing is the one inside your /mnt/sdb1/boot folder, not the one inside /sdb2/32/boot or sdb2/64/boot/

secondl, this is the same setup I have on my device, except I keep the main /boot folder on the ext2 partion (/dev/sdb2) alongside my 32/ and 64/ folders. I don't care to access my boot directory from windows.
Please take a look at our online documentation, here. Suggestions are welcome!

komoornik
White ninja
White ninja
Posts: 16
Joined: 24 Feb 2011, 19:50
Location: Poland

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#8 by komoornik » 25 Jul 2011, 05:19

I'll try this today.

So, is it possible to make the drive bootable from second partition ( this ext2 ) ? Keeping there all the files might even be nicer.

I had a problem with making it bootable from Porteus - I was able to open this lin_start_here.sh only in text editors :cry:

Sorry for my lame questions, but I'm a linux newbie :D

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#9 by brokenman » 25 Jul 2011, 12:58

I was able to open this lin_start_here.sh only in text editors
From a console type: sh /path/to/lin_start_here.sh

This will force it to run as a bash script. Do this as root.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#10 by Hamza » 25 Jul 2011, 13:03

@brokenman,

I read somewhere when you run a script with the interpreter like your example, This can make some troubles with the syntax of interpreter. - is it right?

Normally,
Every intreperter have an unique syntax ??
NjVFQzY2Rg==

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#11 by Ahau » 25 Jul 2011, 21:23

Yes, it's possible to set up your second partition as the boot partition. Just run the lin_start_here.sh script against it, and it will become the bootable partition. You'll of course need to move your /boot/ folder with the main porteus.cfg to that partition as well.

I usually find it easiest to navigate to the folder:
cd /mnt/sdb2/boot/

and then run the script as:

./lin_start_here.sh

but, to each his own :)
Please take a look at our online documentation, here. Suggestions are welcome!

komoornik
White ninja
White ninja
Posts: 16
Joined: 24 Feb 2011, 19:50
Location: Poland

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#12 by komoornik » 31 Jul 2011, 17:16

Thanks guys!

Managed to make it work on the second partition - ext2 one.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#13 by Ahau » 31 Jul 2011, 22:44

great!

Note -- you might get better performance with EXT4, especially if your drive is less than a couple of years old -- I'll be putting out some documentation in the coming weeks that will point to this.
Please take a look at our online documentation, here. Suggestions are welcome!

komoornik
White ninja
White ninja
Posts: 16
Joined: 24 Feb 2011, 19:50
Location: Poland

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#14 by komoornik » 02 Aug 2011, 18:26

My device is Transcend Pico C pendrive.

How I could make the partition ext4 easily?

I was using Partition Manager, but there's only ext2 or ext3.

I always thought ext2 would be faster coz it doesn't have journaling ?

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: 32 bit and 64 bit Porteus on the same USB drive ?

Post#15 by Ahau » 02 Aug 2011, 19:24

Well, I'm in the process of developing some HOWTO's for this, so this is a bit of a sneak peak:

First, you should be able to format a partition using the KDE partition editor included in 64-bit porteus.

Second, EXT 4 does write a journal, but it only journals metadata by default, so it's not actually that much data. EXT4 outperforms EXT2 in every test I've run on them. This journal will improve your ability to recover data in the case of a crash, so I see this upgrade as being the best of both worlds.

Third, I am beginning to believe that it is important to have your flashdrive properly aligned (much more on this to come in my future docs). It is most important to align the start of your partition with the start of your flashdrive's page size (which is usually 4k, 8k, 16k, or 32k in size). Using the KDE partition editor, I have not found a good way to do this (it picks the first sector for you when you select a partition size). It is secondarily important to align your partition to an eraseblock (typically 1, 2, or 4MB, but 1.5, 3MB, 8MB, and 12MB have also been seen). More information can be found on the Linaro Flashcard Survey, here:
https://wiki.linaro.org/WorkingGroups/K ... CardSurvey

They do list a 'SuperTalent Pico-C' flash drive -- I'm not sure if this is the same as yours... anyway, it has a 4MB eraseblock size (pretty standard for modern drives) and 16KB page sizes. Thus, starting a partition on an even 4MB multiple would be best. I use fdisk to setup my partitions this way. It is run from the command line and is not that user friendly, but you can pick the sector where your partition starts.

For example, 'fdisk -l' will show you information for all of your drives, including which sector each partition starts and ends on. A sector is 512 bytes, and is the smallest segment of a drive that can be addressed individually.

Thus, a 4MB partition will have 8192 sectors. So I would start your first partition on sector 8192 (the absolute first sector is sector 0, so sectors 0-8191 equal exactly 4MB). You can use 'fdisk /dev/sdX' to enter the fdisk CLI, press 'p' to print the partition table, 'd' to delete existing partitions, 'n' to create new ones. When you create a new partition, it will ask you for the first and last sector. For example, on my flashdrive, I deleted all partitions, then created a new partition starting on sector 8192 and ending on sector 4095999 (one shy of 4096000, which is 2000MB, a multiple of 4MB), then started my second partition on sector 4096000 and ran it to the end of the drive. Once you've set your partition table, you press 'w' to write it to the drive, and fdisk -l to check that the changes were applied.

Then, you can use mkfs to create a new filesystem on the drive, e.g.

mkfs.vfat /dev/sdb1
mkfs.ext4 /dev/sdb2

Would format the first partition (1996MB) as fat32, and the second partition (the rest of the drive) as ext4.

I'm running short on time, so hopefully this makes sense. I'll have a better doc put together in the next couple of weeks, and it will be more descriptive.

Truth be told -- you probably won't notice much of an improvement in your performance when you have a drive in vs. out of alignment (my drive runs about 15% faster when aligned). However, when you have an unaligned drive, it will decrease the lifespan of your drive (not a big deal if you don't do a lot of writing to it). Basically, an unaligned drive will often have to move one piece of information out of the way to make room for another (since the filesystem's blocks don't line up with the flashdrive's pages), so each write you ask it to perform will actually cause two (or maybe more) writes on the drive. Your flashcards controller can write to more than one location at once, masking this affect in your overall performance.

Ok, I'm short on time. I hope most of this makes sense. lol.

Posted after 9 minutes 13 seconds:
I did not say this, and feel that I should: altering your partition table and/or using mkfs WILL delete all information from the partition/device. The tools described are not newbie friendly, but they are not rocket science, either. proceed with caution. In all likelihood, you will be fine with an unaligned drive, formatted with KDE partition editor.
Please take a look at our online documentation, here. Suggestions are welcome!

Post Reply