Author Topic: [SOLVED] Install to USB flash  (Read 8861 times)

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Install to USB flash
« Reply #15 on: June 11, 2010, 04:42:49 PM »
Why not select to use the complete disk in the installer? -- be sure to select the correct disk!
That should create the required partitions ......  warning you that everything on the disk will be lost.

What about the small partition for Fat32, is that still needed?

Jan


What would you use it for?

If you want a Linux install on a USB device then there is no need for any MS filesystem at all .....  use ext3 or ext4.
If you want to use it with a Win OS then it needs a Win filesystem on the first partition or something like that, else Win cannot see it -- or so I am told.

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: Install to USB flash
« Reply #16 on: June 13, 2010, 08:54:22 AM »
I am trying to install PCLinuxOS to a USB flash drive, as per the instructions I echoed above in this Netbook Hardware thread entitled "Install to USB flash."  I am stuck at the message, “Unable to copy files to new root..”  I have found mention of this problem elsewhere in the PCLinuxOS Help forum, but I don't understand how the solutions apply to my situation.  Here is what I did:

  • The flash drive had two existing partitions, one was ext4, the other was Linux swap.  In fact, a bootable Puppy Linux was on the flash drive.
  • The flash drive was bootable from an older install using unetbootin on a Windows computer.
  • I started “Install PCLinuxOS,” and selected the flash drive, sdc, and I double-checked to make sure that this was where I began.  sda is my regular hard drive, sdb is a 500 GB USB external hard drive.
  • I told the install to use existing partitions, and to check the integrity of the drive.
  • I told the install to set a mount point of “/” on sdc1 (this may well be the error, but I do not know what I should be doing here).  sdc1 was the only partition on sdc that I was offered; the other partitions were on sda.
  • Then I walked away from the computer, because this takes quite a while on a 20GB flash drive.
  • When I returned, I saw the message “Unable to copy files to new root.”
  • At this point, since I was nervous about breaking my regular install, I rebooted, successfully.
  • I then tried another install, without formatting, but with the same mount point, and I got the same error message.

That brings me to the state (PA) in which I now find myself.  I could use help in sorting out the installation procedure.

Thank you,

Jan

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Install to USB flash
« Reply #17 on: June 13, 2010, 11:38:04 AM »
Quote
The flash drive had two existing partitions, one was ext4, the other was Linux swap.

You don't say what size the partitions are

Maybe posting the output of fdisk -l /dev/sd?  (depending on what the drive is at)  would help.

Why not elect to use the complete drive and allow the installer to repartition it?

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: Install to USB flash
« Reply #18 on: June 13, 2010, 12:24:01 PM »
Quote
The flash drive had two existing partitions, one was ext4, the other was Linux swap.

You don't say what size the partitions are

Maybe posting the output of fdisk -l /dev/sd?  (depending on what the drive is at)  would help.

Why not elect to use the complete drive and allow the installer to repartition it?

Code: [Select]
[jan@localhost ~]$ fdisk -l /dev/sdc

Disk /dev/sdc: 8019 MB, 8019509248 bytes
247 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1           1           0    0  Empty
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 1 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 1 does not end on cylinder boundary.
/dev/sdc2   *           1           1           0    0  Empty
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 2 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 2 does not end on cylinder boundary.
/dev/sdc3   *           1           1           0    0  Empty
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 3 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 3 does not end on cylinder boundary.
/dev/sdc4   *           1           1           0    0  Empty
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 4 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 4 does not end on cylinder boundary.
[jan@localhost ~]$
When I read this post, I initially decided to try the complete drive installation you suggested.  However, as it began, I noted that it said something like "formatting partition sda8," or something similar.  I panicked (colonel panic) and managed to stop the installation.  I rebooted and PCLinuxOS (on sda, which is the main hard drive) still works. 

The above code is the result of fdisk -l sdc.  sdc is the flash drive.

I clearly need more instruction, but if you could also tell me why I get that scary message about creating a partition on sda, I would appreciate it.

Thank you,
Jan

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Install to USB flash
« Reply #19 on: June 13, 2010, 12:31:50 PM »
I have no idea what happened about sda8 sorry .....  would have had to be there .....

I would advise that you use PCLOS Control Centre - Local Disks - Manage disk Partitions   to delete all existing partitions on the flash stick, and then after safely removing it and reinserting it, do the fdisk -l command again.

Be AWARE .....  when next plugged in it may not be sdc .....  so check that you are looking at the correct device.   ;)

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: Install to USB flash
« Reply #20 on: June 13, 2010, 04:53:06 PM »
I have no idea what happened about sda8 sorry .....  would have had to be there .....

I would advise that you use PCLOS Control Centre - Local Disks - Manage disk Partitions   to delete all existing partitions on the flash stick, and then after safely removing it and reinserting it, do the fdisk -l command again.

Be AWARE .....  when next plugged in it may not be sdc .....  so check that you are looking at the correct device.   ;)
Code: [Select]
[jan@localhost ~]$ fdisk -l /dev/sdc

Disk /dev/sdc: 8019 MB, 8019509248 bytes
247 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1           1           0    0  Empty
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 1 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 1 does not end on cylinder boundary.
/dev/sdc2   *           1           1           0    0  Empty
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 2 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 2 does not end on cylinder boundary.
/dev/sdc3   *           1           1           0    0  Empty
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 3 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 3 does not end on cylinder boundary.
/dev/sdc4   *           1           1           0    0  Empty
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 0) logical=(0, 0, 1)
Partition 4 has different physical/logical endings:
     phys=(0, 0, 0) logical=(280460, 46, 4)
Partition 4 does not end on cylinder boundary.
[jan@localhost ~]$

I first verified that the flash came back as sdc.

Perhaps I did not erase it properly.  I went to Control Center > Manage Disk Partitions.  I clicked the sdc tab.  I selected "clear all," then I clicked on the partition and again selected "clear all."  The graphic indicator shows only one partition, it does not mention windows, and there are no colors on the display.  However, the message suggests to me that there is still something, perhaps the boot, on the drive.

After I did the above, I decided to see what would happen if I tried to boot from the flash drive.  I put the flash stick in a Windows XP laptop and changed the bios so it would boot from flash first.  The result was strange: it gave me a message about starting Grub, then an error 22.  Clearly it will not boot, but there is still something on the drive, else why would there be a reference to Grub?

By the way, apparently I made some error in my first post of this response, and the post went up as a new thread.  It took me a while to discover that, and some more time to figure out how to copy/paste everything back here.  I am about to delete the other thread.

Jan

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Install to USB flash
« Reply #21 on: June 13, 2010, 06:13:10 PM »
The reference to Grub is normal ......  as you had Grub as the boot manager in the MBR of that drive, I understand.

It looks to me that you need to delete the partition table and recreate it as a normal DOS partition table.
Unless you do that I don;t see much hope of getting a consistent result from that flash drive. I have had to do something very similar to 4 flash sticks I bought.

I used fdisk to delete the partition table and also to recreate it. (Think it might have been called a DOS label in fdisk, not sure.)  Late here so cannot get into that at the moment as I am heading to bed.

If you need help to go through that let me know and I will look to it tomorrow if no one else comes along in the meantime.

regards.

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: Install to USB flash
« Reply #22 on: June 13, 2010, 08:37:04 PM »
The reference to Grub is normal ......  as you had Grub as the boot manager in the MBR of that drive, I understand.

It looks to me that you need to delete the partition table and recreate it as a normal DOS partition table.
Unless you do that I don;t see much hope of getting a consistent result from that flash drive. I have had to do something very similar to 4 flash sticks I bought.

I used fdisk to delete the partition table and also to recreate it. (Think it might have been called a DOS label in fdisk, not sure.)  Late here so cannot get into that at the moment as I am heading to bed.

If you need help to go through that let me know and I will look to it tomorrow if no one else comes along in the meantime.

regards.


John Boy,

Well, I guess I will do that.  I was hoping to be a Joble purist and use only PCLinuxOS for the job, but if you say I should use fdisk, so be it.  It seems that there is an fdisk command in Linux, but no way am I going to undertake this without the safety net of a GUI.  I will try one of the XP machines.  However, of some good soul will give me the exact command, I would be willing to try the PCLinuxOS that I have on another, noncritical, computer to do the format.

Here is something from he Linux Man for fdisk:

Quote
The DOS 6.x FORMAT command looks for some information in the first sector of
       the data area of the partition, and treats this information as more reliable
       than the information in the partition table.  DOS FORMAT expects  DOS  FDISK
       to clear the first 512 bytes of the data area of a partition whenever a size
       change occurs.  DOS FORMAT will look at this extra information even  if  the
       /U flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK.

       The  bottom  line is that if you use cfdisk or fdisk to change the size of a
       DOS partition table entry, then you must also use dd to zero the  first  512
       bytes  of  that  partition  before using DOS FORMAT to format the partition.
       For example, if you were using cfdisk to make a DOS  partition  table  entry
       for  /dev/sda1,  then  (after exiting fdisk or cfdisk and rebooting Linux so
       that the partition table information is valid) you would use the command "dd
       if=/dev/zero of=/dev/sda1 bs=512 count=1" to zero the first 512 bytes of the
       partition.

This may be the reason that the flash drive must be reformatted by something other than what is available in the installer.

Jan

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Install to USB flash
« Reply #23 on: June 14, 2010, 04:08:30 AM »
fdisk is the utility that can be used to create a correct setup on the flash disk.
It is run from the command line, by choosing options presented to the user.
After all changes have been recorded for the session, the user must choose to Write those changes to the drive for them to take effect. Should the user Quit before Writing the changes, then no changes are implemented.

Remember in this case it is the disk itself that is being worked on, and not a partition on that disk. So, it is the Structure of the disk, which allows partitions to be added and formatted that needs to be rectified.

I plugged in a USB flash drive into my PC, which takes the device node  /dev/sdh, and its one partition is   /dev/sdh1.
I will go through the commands in a Konsole and post them and the output below so you can see what you should expect, and the sequence you should adopt.

So here goes .....

1. Find out what device node the flash drive has

Code: [Select]
[user@Dell ~]$ fdisk -l

Disk /dev/sdf: 32 MB, 32112640 bytes
2 heads, 32 sectors/track, 980 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               2         980       31328    4  FAT16 <32M

Disk /dev/sdh: 4116 MB, 4116709376 bytes
127 heads, 62 sectors/track, 1021 cylinders
Units = cylinders of 7874 * 512 = 4031488 bytes
Disk identifier: 0x0def5ab7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1   *           1        1021     4019646   83  Linux
[user@Dell ~]$


I can see from the above that the flash stick is a 4GB drive and is located at /dev/sdh and has one partition on it.

Now I must work on the Drive and not the partition so here we go .....

Code: [Select]
[user@Dell ~]$ fdisk /dev/sdh

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):


After the first command was entered I choose "m" to see the help menu. Next I will choose whichever option I wish -- in this case I want to creat a new Partition Table so choose "o" and get the following ....

Code: [Select]
Command (m for help): o
Building a new DOS disklabel with disk identifier 0x11c9a3a8.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):


This is as far as I went.
In your case all is needed is to enter "w" to confirm the new Partition Table should be written  to your disk. After that completes you Quit ("q"), extract the stick and after a little time, reinsert it, and then check it with the
fdisk -l
command again. It should now not show any errors in the partition table.

From there on you can use any partitioner you wish to create partitions on the drive.
Should you wish to do so, fdisk can be used to create the partitions also. Selecting "n" will help create a new partition if you wish to use fdisk for the job.

First things first ........  get the partition table corrected and then decide about the partitions themselves.

regards.


Offline Yankee

  • Hero Member
  • *****
  • Posts: 1489
  • In theory, theory=practice, in practice ???
Re: Install to USB flash
« Reply #24 on: June 14, 2010, 01:11:01 PM »

Had to reinstall once, but now have half a Gig of swap unmounted but mountable.
The other 15.9 Gig full of PCLinux in an xfs partition.  Found the master volume
for the speaker so CD's work.  Still fumbling for a replacement keyboard command
to get the wifi card on and off.

Otherwise looks OK.

Can you install with only one flash drive ?   Using the full disk or partition ?


Patrick

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 Yankee

  • Hero Member
  • *****
  • Posts: 1489
  • In theory, theory=practice, in practice ???
Re: Install to USB flash
« Reply #25 on: June 14, 2010, 01:32:13 PM »

Jan,

A reference to Grub and did not boot...I had the same problem.

Had to reinstall once, hit something in advanced settings accidentally
that did that.  Reinstalled without changing settings where GRUB is concerned.
The default setting boots right thru with no problem.  Like I said I
don't know what setting I hit but it caused a text-based Grub to
appear and hangup the boot.  The graphical Grub is OK all the way thru boot.

Used PCC to partition and format, be sure your swap area is on the right hand side.
Sounds like you should use the full disk (flash drive) and give it a try.


Patrick

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 Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: Install to USB flash
« Reply #26 on: June 15, 2010, 07:26:23 AM »
I am still stuck. Here is what I did.

  • In a different computer that has PCLinuxOS I opened a console and typed fdisk -l and it called the drive sdb.
  • I typed fdisk/dev/sdb and gave it the command o, followed by w.  It responded that one or another program must be run or a reboot was required.
  • I rebooted and I could then see the new drive, it had no partitions and no error messages.
  • At this point, I discovered that nowhere, as a user or as root, could I find an icon or a menu item offering to install PCLinuxOS.  Rather than fight this battle, I returned the flash to the main computer, where I am now.
  • I started "Install PCLinuxOS" and it showed only two choices, and I chose to use the whole partition.
  • After a while I received the message "Unable to copy files to new root."

I seem to be back where I started.  

Jan
« Last Edit: June 15, 2010, 07:36:03 AM by Ditzian »

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1489
  • In theory, theory=practice, in practice ???
Re: Install to USB flash
« Reply #27 on: June 15, 2010, 07:56:35 AM »

Great.  Then it will not install to the same flashdrive.  Go to ebay if you don't have
a CD burner (where the iso should be anyway) and buy another flashdrive.

Put the iso on one flash, instead of burning it to CD, boot up and target the new flashdrive
for the install.  Use PCC to partition and format the target in expert mode from the iso. 

I bought a 32 Gig flashdrive yesterday, auction prices were $16.50 to $28.50, shipping
included.

The above works OK.


Patrick



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 Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Install to USB flash
« Reply #28 on: June 15, 2010, 08:35:39 AM »
I am still stuck. Here is what I did.

  • In a different computer that has PCLinuxOS I opened a console and typed fdisk -l and it called the drive sdb.
  • I typed fdisk/dev/sdb and gave it the command o, followed by w.  It responded that one or another program must be run or a reboot was required.

I instructed that you should remove the drive after quitting the fdisk utility.  It is not necessary to reboot when changing the partition table on removable media!

Quote
  • I rebooted and I could then see the new drive, it had no partitions and no error messages.

I am only guessing here as you have not said ....  what did your "SEE" it with?    fdisk?  I will assume so in the absence of any other info ....

Good - so the correction made by fdisk was applied.

Quote
  • At this point, I discovered that nowhere, as a user or as root, could I find an icon or a menu item offering to install PCLinuxOS.  Rather than fight this battle, I returned the flash to the main computer, where I am now.

If the icon was not present then you could have launched the installer from the Konsole ....  or you could have asked ...

Did you create any partitions?
What did you use to create the partitions if you did so?

Quote
  • I started "Install PCLinuxOS" and it showed only two choices, and I chose to use the whole partition.

What partition? Did you create one?
Are you sure it did not offer to use the whole disk?

There is a world of difference between a partition and a disk .......  if you do not report actual exact information in your posts then I have no hope whatsoever of knowing what is happening!

Quote
  • After a while I received the message "Unable to copy files to new root."

I seem to be back where I started. 

Jan


I have no idea if you are back where you started .........  you have not reported anything that tells me what the state of the flash disk is!   ???

Post the output of
fdisk -l
where it reports the information about the flash stick.

Without that information I have no idea what is going on .....

Questions:
                  From what are you trying to install to the flash drive?  If it is an existing install then how much space does it need to install?  Is it more than the total size of your flash drive?

regards.
« Last Edit: June 15, 2010, 08:38:01 AM by JohnBoy »

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: Install to USB flash
« Reply #29 on: June 15, 2010, 09:02:59 AM »
Rather than quote JohnBoy's post with specific questions, I will try to post answers to the operational questions.

I am at my original computer, the one that has an install menu item.  Here is the fdisk command:

Code: [Select]
[jan@localhost ~]$ fdisk -l

Disk /dev/sdc: 8019 MB, 8019509248 bytes
247 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Disk identifier: 0xde2fa8bd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1         917     7021438   83  Linux
/dev/sdc2             918        1022      803985    5  Extended
/dev/sdc5             918        1022      803954   82  Linux swap / Solaris
[jan@localhost ~]$

I did not create any partitions prior to trying the install. If I should do this, then I am ready to try PCLinuxOS Control Center, unless there is a better solution using a console.

I believe that I must not understand what a partition is; I thought that, from above, I had three partitions, sdc1, sdc2, sdc5.  If these are partitions, and if fdisk did not create them, then I can only guess that they are the result of the install procedure, despite the error message.

Since I am only trying to get the procedure down, I also thought that all I needed for a simple installation was one partition for PCLinuxOS.  If I get a working persistent installation, then I may start over and make custom partitions as needed.  However, this was not to be a sophisticated installation, I only intended to plug the flash drive into a netbook and run PCLinuxOS when away from home.

The reason I rebooted was that this was one of the options presented to me in the console output.

I also have a pclos 2010 iso, and I am willing to try an install with that.  I am becoming more confident in my ability to recognize the different drives, and to select the flash drive correctly.

Please let me know if I missed an important response.

Thank you,

Jan
« Last Edit: June 15, 2010, 09:19:54 AM by Ditzian »