Author Topic: (SOLVED) Multiboot using USB Pendrive and chroot error at boot  (Read 2198 times)

Offline unist

  • Full Member
  • ***
  • Posts: 158
(SOLVED) Multiboot using USB Pendrive and chroot error at boot
« on: October 09, 2012, 08:23:30 PM »
I am trying to boot other Distros from a USB Pendrive. So far, applying the conclusion from this thread: http://www.pclinuxos.com/forum/index.php/topic,109226.15.html I succeeded with Knoppix 7.04.

In a partition of the USB Pendrive I unsuccessfully tried other Distros: Salix OS Live XFCE 13.37-64, and PCLinux OS LXDE 2012-06. I also did not succeed replacing this Pendrive with different ones specifically made from the Distros: Slitaz 4.0, Puppy Linux 5.28.005 and Slax 6.1.2. In all these cases the Distros initiated the boot process but then I obtained a boot error, from which I had to do a forced boot directly from the PC button. I added the corresponding new stanza to /boot/grub/menu.list. Live CDs for all these Distros worked as expected.

My motivation for doing this is to continue learning Linux, entering from time to time in different Distros. My main Distro is PCLinux OS KDE 2012 (64-bit kernel fully updated), which I have installed in Hard Disk. For experimenting with several Distros I opted for USB Pendrive versions since this will not touch my Hard Drive installation.

Looking at the boot error I saw an indication that chroot was not found.

After a search in this Forum and with Google, I concluded that what I need to do is to add the Directory of chroot to the Path:

For all users except root, in /etc/profile:

PATH=$PATH:/usr/sbin/chroot
export PATH

For root, in /root/.bash_profile:

PATH=$PATH:/usr/sbin/chroot
export PATH

I would like to confirm my plan before doing the modifications in the two files. Thank you.
« Last Edit: October 18, 2012, 07:15:19 PM by unist »
Registered Linux user #547260

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10615
  • MLUs Forever!
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #1 on: October 10, 2012, 02:21:10 AM »
Is there a reason you are not booting directly from the USB drive?

IMO this is the best method of using such live sessions.
The internal HDDs are not accessed, even for the boot manager.

Quote
In a partition of the USB Pendrive I unsuccessfully tried other Distros: Salix OS Live XFCE 13.37-64, and PCLinux OS LXDE 2012-06.


What application did you use to 'install' each distro you tried?

PCLOS has LiveUSB creator which will install PCLOS (in live mode) on any partition of a removable drive. It is for PCLOS ISOs only.


Some threads that might be of interest ...

http://www.pclinuxos.com/forum/index.php/topic,88330.0.html

http://www.pclinuxos.com/forum/index.php/topic,74878.0.html

http://www.pclinuxos.com/forum/index.php/topic,82277.0.html
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline unist

  • Full Member
  • ***
  • Posts: 158
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #2 on: October 10, 2012, 01:01:10 PM »

Is there a reason you are not booting directly from the USB drive?

What application did you use to 'install' each distro you tried?


The only reason for not booting directly from the USB drive is for not changing the boot sequence in BIOS. I will opt for booting directly if I don´t find a secure method for booting using the grub menu.

I installed the distros in the USB drive using the facility provided in each corresponding Live CD.

I will review the information from the links in your post.

Thank you very much for your answer.
Registered Linux user #547260

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1475
  • In theory, theory=practice, in practice ???
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #3 on: October 10, 2012, 04:57:31 PM »

The only reason for not booting directly from the USB drive is for not changing the boot sequence in BIOS. I will opt for booting directly if I don´t find a secure method for booting using the grub menu.


If you press esc or F10 at the first boot screen you can select the boot device
on most machines.   

Also, fully installing PCL on a pendrive is quite possible. Install from LiveCD to
the USB as you would a full install to the HD, be sure to fully install grub to the MBR of the
pendrive at the last screen (sdc1 probably but be sure),  change grub's menu.lst
on the pendrive  so sdc1 (hd2,0) is changed to hd0,0.       

Should boot right up.


FF
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline unist

  • Full Member
  • ***
  • Posts: 158
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #4 on: October 10, 2012, 09:16:10 PM »

The only reason for not booting directly from the USB drive is for not changing the boot sequence in BIOS. I will opt for booting directly if I don´t find a secure method for booting using the grub menu.


If you press esc or F10 at the first boot screen you can select the boot device
on most machines.    

Also, fully installing PCL on a pendrive is quite possible. Install from LiveCD to
the USB as you would a full install to the HD, be sure to fully install grub to the MBR of the
pendrive at the last screen (sdc1 probably but be sure),  change grub's menu.lst
on the pendrive  so sdc1 (hd2,0) is changed to hd0,0.      

Should boot right up.

FF

From the Live CD I installed PCLinux OS LXDE in USB drive as single OS and booted directly without any problem.

But when I tried to install similarly in the ext4 partition of a USB drive, the installer stopped and refused to continue when I selected the ext4 partition. In this USB drive first partition is FAT32 in which I have Knoppix 7.04. Second partition is ext4, in which I tried to install PCLinux OS LXDE.

For this USB drive, the corresponding output from fdisk -l is:

Disk /dev/sdi: 32.0 GB, 32015679488 bytes
255 heads, 63 sectors/track, 3892 cylinders, total 62530624 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: 0x000a62f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdi1               1    26640383    13320191+   c  W95 FAT32 (LBA)
/dev/sdi2   *    26640384    62529535    17944576   83  Linux

Does the "*" in /dev/sdi2 have any relation with the problem in creating the Live USB?

(I will be on this PC and issue next tuesday October 16)
« Last Edit: October 10, 2012, 09:21:55 PM by unist »
Registered Linux user #547260

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10615
  • MLUs Forever!
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #5 on: October 11, 2012, 02:21:48 AM »
Quote
From the Live CD I installed PCLinux OS LXDE in USB drive as single OS and booted directly without any problem.

But when I tried to install similarly in the ext4 partition of a USB drive, the installer stopped and refused to continue when I selected the ext4 partition.

For the reader there is no difference in what you did in the two statements above ....  yet you got two different results.

You have supplied no information to allow anyone to determine what you did differently.

I *suspect* in the second case you have used an older version of the utility, which states you must use an ext2 or ext3 partition. ext4 was not supported in the older versions.

You need to supply details of of the running OS and the version of the utility used when installing, else we can only continue to guess at the details of what you are doing.

The  *  indicates the boot flag which Linux does not use or care about.
Some hardware would want to see that on the Win partition ....  apparently your hardware does not care.
« Last Edit: October 11, 2012, 02:23:42 AM by Just17 »
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline unist

  • Full Member
  • ***
  • Posts: 158
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #6 on: October 11, 2012, 08:47:54 AM »

You have supplied no information to allow anyone to determine what you did differently.

I *suspect* in the second case you have used an older version of the utility, which states you must use an ext2 or ext3 partition. ext4 was not supported in the older versions.

You need to supply details of of the running OS and the version of the utility used when installing, else we can only continue to guess at the details of what you are doing.


The running OS is the Live CD PCLinux LXDE 2012-06 for both cases, using utility provided in it to create Live USB.

I used two different USB drives:

- For the case that worked fine, it was a 16 GB Pendrive with ext4 format.

- For the case in which I could not install PCLinux, I used a 32 GB Pendrive that have FAT32 in its first partition with Knoppix 7.04 in it, and with second partition formatted as ext4.

Later, I decided to reformat again this partition as ext4, since I suspect there is a problem with the format, because I used this partition in the several unsuccessful intents mentioned in my first post of this thread. I still have not used again the utility to create Live USB from the Live CD PCLinux LXDE 2012-06 to see if I can install the OS in second partition of the 32 GB Pendrive. As soon as I return home by Tuesday October 16, I will do it and post the result.

Thank you for your post.
« Last Edit: October 11, 2012, 08:57:51 AM by unist »
Registered Linux user #547260

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10615
  • MLUs Forever!
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #7 on: October 11, 2012, 10:33:08 AM »
The LiveUSB utility is capable of installing the Live session on any partition on your USB drive ...  up to 99 I *think*  :D

I checked it up to 19 IIRC.  Others might have used even higher numbered partitions.

If the utility could install to one ext4 partition then all is OK ...  you are not using an older version which did not support ext4.

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1475
  • In theory, theory=practice, in practice ???
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #8 on: October 11, 2012, 01:50:22 PM »
I don't think it would hurt from the LiveCD to run "draklive-install-lock-storage"
from root terminal if all else fails.   If it still hangs up the terminal should give a
clue as to what occurred.   

Does Knoppix use grub legacy ?    It might not.   Then the PCL install would have
to have grub installed as before and Knoppix added to the PCL installs'  menu.lst.

Theoretically it should work.    Hear from you next week then.


FF
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline unist

  • Full Member
  • ***
  • Posts: 158
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #9 on: October 11, 2012, 02:05:46 PM »
Ferdes Fides and Dorian Just17: this is to let you know that I read your posts. Next week I will be back on action!

P.S.: I made a mistake mentioning the names of the participants in this thread.
« Last Edit: October 16, 2012, 08:15:56 PM by unist »
Registered Linux user #547260

Offline unist

  • Full Member
  • ***
  • Posts: 158
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #10 on: October 16, 2012, 08:05:37 PM »
Back again. This is what I obtained:

First: The problem that I reported with the  PCLinuxOS Live USB Creator, using the second partition of the USB Pendrive was solved, once I re-formatted it as ext4. I could make the install of PCLinuxOS LXDE 2012-06 using the Live CD.

Second: I could not successfully boot from the computer using a boot entry from my main installation, which is  PCLinuxOS KDE fully updated, with the pae.bfs, kernel 2.6.38.8 for 64-bit.

I have two physical hard drives: one with Windows 7 and the second with PCLinuxOS KDE.

I also have two USB Pendrives: one dedicated for ReadyBoost, and the second one partitioned with Knoppix 7.04 (FAT32 format) its first partition, and the second partition for a Linux Distro (ext4 format), PCLinuxOS LXDE in this case.

The boot stanza that I use for the USB Pendrive is:

title Knoppix 7.04
root (hd3,0)
chainloader +1

title Linux Distro USB
root (hd3,1)
chainloader +1

Knoppix boots fine. PCLinuxOS LXDE, for Linux Distro USB produces the following otuput:

booting “LXDE”

kernel (hd0,1) /LXDE1/vmlinuz LiveCD=/LXDE1 fromusb root=UUID=50e9131d-4b6e-4f95-b873-33608559fd87 acpi=on vga=791 quiet splash=silent vmalloc=256M

ERROR 17=Cannot mount selected partition

Press any key to continue

This output came in a black screen. I copied this text by hand, and I can recall exactly if all capital letters in my text above were shown as such, but the wording and numbers are correct.

The only way to recover was by a hard reboot, since all entries for the new boot menu of the USB Pendrive partition produced the same output.

I tried two USB installs of PCLinuxOS LXDE with same result. The variant was the grub option from the last window of the facility. I used option 2 for grub install in the partition to allow chainload from my main install, and option 3, for grub install in the boot sector of the partition.

I did a google search for "ERROR 17=Cannot mount selected partition" but I did not find a reference to apply for this case, at least to my knowledge. The closest clue was an indication for a related problem when booting from external USB drive, but could not find how to address this situation. I also read a problem associated to kernel for 64-bit, which is my case. But again I did not catch how to apply or adapt a solution.
« Last Edit: October 16, 2012, 08:18:50 PM by unist »
Registered Linux user #547260

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1475
  • In theory, theory=practice, in practice ???
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #11 on: October 16, 2012, 08:34:47 PM »
Code: [Select]
Grub Error 17

Situation

Code Listing 5.1: Grub Output
root (hd0,0)
filesystem type unknown partition type 0x7

Error 17 : Cannot mount selected partition
Solution

This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.

Be sure to check your root(x,y) settings in your grub.conf.

Also, if you are trying to boot Windows, make sure that your grub.conf file has the root (hdX,Y) (or rootnoverify (hdX,Y)) and chainloader (hdX,Y)+1 in it.

My only question:  the Knoppix install is a full install, the LXDE install is a LiveUSB install ?

Hope the above helps.
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10615
  • MLUs Forever!
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #12 on: October 17, 2012, 04:24:57 AM »
Quote
title Knoppix 7.04
root (hd3,0)
chainloader +1

title Linux Distro USB
root (hd3,1)
chainloader +1

Knoppix boots fine. PCLinuxOS LXDE, for Linux Distro USB produces the following otuput:

booting “LXDE”

kernel (hd0,1) /LXDE1/vmlinuz LiveCD=/LXDE1 fromusb root=UUID=50e9131d-4b6e-4f95-b873-33608559fd87 acpi=on vga=791 quiet splash=silent vmalloc=256M

ERROR 17=Cannot mount selected partition

Press any key to continue

You are not taking into account that the LiveUSB installer is creating an install on a bootable drive.
The boot drive as Grub sees it will be the first drive .....  (hd0)

In your case the drive you wish to boot PCLOS from is the fourth drive (hd3)

So I suggest you edit the boot menu entries to reflect your different usage.

Replace all instances of  (hd0,1)  with  (hd3,1)  for the PCLOS boot entries.

It should be noted of course that this (hd3) could change at any time, dependent on hardware attached to the PC.

You might also need to delete the 'fromusb' boot option if things do not go right  .....  I cannot recall as I write .....

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline unist

  • Full Member
  • ***
  • Posts: 158
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #13 on: October 17, 2012, 06:14:08 PM »
My only question:  the Knoppix install is a full install, the LXDE install is a LiveUSB install ?

Hope the above helps.

Both, Knoppix and PCLinuxOS LXDE are LiveUSB installs

I will dig in using your hints. Thank you.
Registered Linux user #547260

Offline unist

  • Full Member
  • ***
  • Posts: 158
Re: Multiboot using USB Pendrive and chroot error at boot
« Reply #14 on: October 17, 2012, 07:18:25 PM »
Quote
title Knoppix 7.04
root (hd3,0)
chainloader +1

title Linux Distro USB
root (hd3,1)
chainloader +1

Knoppix boots fine. PCLinuxOS LXDE, for Linux Distro USB produces the following otuput:

booting “LXDE”

kernel (hd0,1) /LXDE1/vmlinuz LiveCD=/LXDE1 fromusb root=UUID=50e9131d-4b6e-4f95-b873-33608559fd87 acpi=on vga=791 quiet splash=silent vmalloc=256M

ERROR 17=Cannot mount selected partition

Press any key to continue

You are not taking into account that the LiveUSB installer is creating an install on a bootable drive.
The boot drive as Grub sees it will be the first drive .....  (hd0)

In your case the drive you wish to boot PCLOS from is the fourth drive (hd3)

So I suggest you edit the boot menu entries to reflect your different usage.

Replace all instances of  (hd0,1)  with  (hd3,1)  for the PCLOS boot entries.

It should be noted of course that this (hd3) could change at any time, dependent on hardware attached to the PC.

You might also need to delete the 'fromusb' boot option if things do not go right  .....  I cannot recall as I write .....



I replaced all instances of  (hd0,1)  with  (hd3,1)  for the PCLOS boot entries in the USB drive and PCLinuxOS LXDE finally came in!!!

I did not delete the "fromusb" boot option.

The system passed fast through several black screens with some information that I could not recall or take notes, but anyway PCLOS LXDE entered. I selected the boot option entry for persistence.

This experience is important for me as knowledge of the system, and I will experiment with other OS in different USB Pendrives, in order to keep the PCLOS LXDE install in its current Pendrive.

Once I fell more secure with the system, what I would like to have is a permanent install of a new OS in a partition of the hard drive in which I have PCLinuxOS KDE.

I will also have to validate how to address the issue related to chroot problem mentioned in my initial post of this thread, and my proposed change in "/etc/profile" and in "/root/.bash_profile" to include chroot in the path for all users except root, and in root, respectively. This chroot problem appeared with other OS's mentioned in that post.

Thank you very much for your orientation. Once more, I verified the usefulness of this Forum and the receptivity of the participants.

« Last Edit: October 17, 2012, 07:21:56 PM by unist »
Registered Linux user #547260