U3 pendrives, great for linux live

Here you can post about your various experiences with PC hardware. You can also post about hardware that is not compatible with the linux kernel or not recommended for use with Porteus.
User avatar
Mithrandil
Power user
Power user
Posts: 29
Joined: 28 Dec 2010, 16:02
Distribution: Gentoo, PixieLive
Location: IT
Contact:

U3 pendrives, great for linux live

Post#1 by Mithrandil » 03 Jan 2011, 08:13

Yesterday i made some tests with my SandDisk Cruzer 16GB USB pendrive, this is what i discovered (i know, most of you already know that, but for the others that could be interesting):
  1. U3 pendrives are made by a CD-like read-only partition + a mass storage device (USB pendrive)
  2. They appear as 2 different devices (/dev/sr1 and /dev/sdxY)
  3. The memory is shared between the CD and the memory, so, the bigger is the CD, the smaller is the free Memory
  4. You can replace the ISO image on your pendrive with an ISO of your choice (with u3-tool), and it will appear as a real CD device
  5. The CD device can be booted as a normal CD, probably also on devices which don't allow boot from USB, anyway not sure about that (not on APPLE stuff, tested)
  6. The CD part is readonly, (i.e. noobproof, you can borrow it to anyone, and they will not accidentally delete your slax nor boot folder)
  7. The ID (/dev/disk/by-id/*) of the CD device is similar to the ID of the mass storage part (i.e. the pendrive partition can be easily recognized by any script)
How-to (assuming you don't have any encrypted partition on your pendrive):

DISCLAMER: if you don't know what commands mean, don't do it, this could destroy you computer, your fridge, and even your microwave oven. :evil:
  1. Make | take an ISO of your preferred live distro
  2. Insert your U3 pendrive into your computer
  3. Backup ALL the data on your pendrive, they will be lost after this process
  4. # u3-tool -i /dev/sdxY (where sdxY is your u3 pendrive)
  5. # u3-tool -p XXXXXXXXX /dev/sdxY (where XXXXXXXX is the size in bytes of your ISO (may be something more than the size, you can get the size with "ls -l YOUR_ISO.iso")
  6. u3-tool -l YOUR_ISO.iso /dev/sdxY
  7. wait for the process to finish --> your CD is ready, now you have to partition the memory device according to the new size
  8. # fdisk /dev/sdx
  9. create a fat32 partition on the device (maximum size)
  10. save the new partition table
  11. # mkfs.vfat /dev/sdxY
  12. enjoy your customized CD+USB pendrive
PixieLive developer www.pixielive.org