3

I'm trying to install Linux on a single partition of a USB flash drive that's larger than 4gb.

The first place I went to is http://pendrivelinux.com. I can follow these instructions for installing Xubuntu 9.04 perfectly, which unfortunately break down when I try to scale it up beyond 4gb.

There are several other tools to do this (unetbootin and usb-creator) which follow a very similar formula.

I figured out that a big problem of mine was that all of these tools assume the USB drive is formatted in FAT32, which unfortunately cannot hold a single file larger than 4gb. This is unfortunate because I want to use just one partition, so that my persistance file, casper-rw, looks like one big partition to the OS once I've booted off of the USB drive.

I then tried following a myriad of instructions involving formatting the drive as one large ext2 filesystem and using extlinux to create a single bootable ext2 file system.

This doesn't work for me however, after about 20 attempts verifying and slightly tweaking the formula, I cannot seem to get a "good" bootable ext2 file system built. I'm not entirely sure what's going on, but it seems as though no matter how hard I try, I cannot get the ext2 file system to remain coherent after copying the Linux ISO contents over, copying the MBR, and executing extlinux to create the ext bootloader.

Every time, after I follow these steps (in any order) and reboot, I get an unbootable USB drive. If I then mount the drive under Linux again, I see a mess of a file system (inodes have clearly been screwed up somewhere along the way).

I suspected that the USB drive wasn't being fully flushed, so I tried using the "sync" and "unmount" commands before rebooting which didn't affect things at all.

I guess I have several possible questions - but let's start with the obvious - is there something I'm missing to create a bootable ext2 USB flash drive that's large (e.g. 16gb)?

Chris Harris
  • 181
  • 1
  • 5
  • I wouldn't expect a bootable ext2 to be difficult on usbflash, but since I've never done it, I can't comment. However, why not just use a small (~64–128mb) fat32 for /boot and then the rest as ext2? – derobert Jul 26 '09 at 22:48
  • My idea was to load an entire xubuntu image, and so when I install package updates, load data, save settings, etc. I didn't want to have to worry about where it was all being stored. However, if you think I'm crazy -- by all means how would you partition the disk exactly? The Xubuntu pendrivelinux install is 700mb, so how do I load /boot portion of the image into one partition, but not the rest? – Chris Harris Jul 26 '09 at 23:26

3 Answers3

2

Ubuntu now includes a "install to USB" option in the system menu. This is your best bet and does not require trying to cram a large file onto the stick - instead, files are stored "normally", which means you'll be able to get around the 4Gb barrier.

Install gparted to assist with this:

sudo apt-get install gparted
sudo gparted

If the GUI method doesn't work, try directly formatting through the command line instead.

The file size limitation still applies, so if you plan on having large files, Ext2 is still your best choice. Format it as Ext2 and then use the provided tool to do the install.

If you're stuck in a chicken-and-egg situation (only have a Windows install to work with but no live Linux install) you could burn the ISO to a CD, boot the CD, download and install the partition program, run it to partition the stick, and then run the USB install from there.

Avery Payne
  • 14,326
  • 1
  • 48
  • 87
2

I have a Partitioned 16 GB USB drive installed with Ubuntu 9.04 on a partition larger than 4GB.
I can mount other partitions properly.
This was done as Avery suggests, using the Ubuntu LiveCD 'Install to USB' option, very easily.

As an aside,

  • I have the boot partition on ext4 -- not sure if that's a good idea yet, i am experimenting. I have also done a ext3 install earlier.
    Update: I have since shifted to ext2 and found it much more comfortable. You don't need journaling on a flash drive.
  • The USB boot works quite well across hardware platforms (laptops, workstations with varying hardware configurations)

Some points,

  • Once you decide to partition the USB, it does not work on Windows systems.
    So, it might be useful to let the Ubuntu LiveCD do the partitioning
  • ext3 and ext4 are known to do more writes (journaling); i guess, you are trying ext2 for that reason.
    But, that also leaves you out with a risky install that could blackout on a crash or bad sync.
    Update: I usually have backup power so this is not really a problem.
    But, I have recovered the ext2 very easily from such crashes on this system.
  • I like to do a sudo sync before shutdown, still trying to figure out if it is a good idea or just a waste of time :-)

There is also USBuntu, if you want to try it -- a.k.a. LiLi; or, is that what you refer as USB Creator already?

nik
  • 7,040
  • 2
  • 24
  • 30
0

Avery's answer is not true at least in 9.10. The USB creator in Ubuntu only allows you to set up in Fat32. That is it.