• Aucun résultat trouvé

Using Desktop CD Persistence

Live CDs like the Ubuntu Desktop CD provide an easy way to temporarily turn any compatible computer system into an Ubuntu Linux system. However, the fact that most Live CDs don’t pro-vide any sort of persistent storage for configuration data, custom applications, and so on (other than manually copying files to other local or networked storage) traditionally limited the practical usability of Live CDs to simple demonstrations, one-time experimentation, and general system repair and recovery efforts. Luckily, things are better now — thanks to some really clever people, it’s fairly easy to automatically save changes that you make when running from the equivalent of an Ubuntu Desktop CD — and without having to deal with manually mounting and unmounting filesystems, saving your work there, and so on.

Earlier Ubuntu releases introduced a mechanism for associating persistent storage with the Live CD boot process. This mechanism enabled you to format an external storage device with a spe-cial name (caspar-rw) and use that at boot time (in conjunction with the Desktop CD), adding a special kernel boot option (persistent) to tell the boot process to use the contents of that device to restore desktop settings, personal data, and even installed applications. This approach had a few problems, the most significant of which was that it required both an external storage device (typi-cally a USB flash memory stick) and an Ubuntu Desktop CD. Aside from the hassle of carrying around both of these, my particular complaint was that my Desktop CDs kept breaking when I put them in my back pocket and then sat on them.

Luckily, improvements in flash drive size, price reductions for flash drives, and software improve-ments have made being able to do real work from an Ubuntu Desktop CD even easier. Ubuntu systems include an easy-to-use command for creating a bootable USB flash drive (generally referred to as a stick) that works like the Desktop CD but provides persistent storage when boot-ing usboot-ing the “Try Ubuntu without any change to your computer” option. This gives you a por-table Ubuntu system from which you can either run Ubuntu or install it on another computer system without requiring the use of a CD drive. All you need nowadays for this type of portable Ubuntu system is a USB flash drive that is at least 2 GB in size.

Caution

If you want to create a bootable UsB flash drive manually, the folks at penDriveLinux.com

(www.pendrivelinux.com) have some truly useful tutorials that will walk you through the process of manually creating a bootable Ubuntu system on a UsB stick and just about anything else that you could conceivably boot from a UsB stick. Their tutorials are clearly explained and eminently readable, and also often include scripts and configuration files that you can download from their site to make things even easier for you. n

Flash drives are great — they are fast, use far less energy than hard drives, don’t generate heat, don’t make noise, and have no moving parts that can stop moving when you drop them down a flight of stairs. On the down side, they do have one potential limitation that you’ll hear people talk about — you can only write to each underlying storage unit a certain number of times. (Flash storage units are usually referred to as cells or address blocks, and are analogous to the sectors on a standard hard drive.) Luckily, most flash drives use a technique known as wear-leveling to evenly distribute writes across the drive, so that no single area on the drive gets written to more frequently than another. The longevity of a modern flash drive is usually predicted to be at least 5 or 10 years. If you’re still running Ubuntu off the same flash drive 5 years from now, it might be time to finally consider an upgrade. You are backing up your “real work” anyway, right?

Note

In order to use the bootable UsB flash drives discussed in this section, your computer system must be able to boot from a UsB device. Most modern pCs support this, but you should certainly check before bothering to create a bootable UsB stick that you can’t use. Booting from UsB devices is usually a standard BIOs boot option, but some systems also require that you manually enable UsB BIOs support before you can boot from a UsB device. n

As mentioned previously, the Ubuntu Desktop provides an easy, graphical mechanism for cre-ating a bootable USB flash drive that works much like the Desktop CD, but that also provides persistent storage so that any system settings that you configure, applications that you install, and files that you create are preserved across reboots. This application will try to reuse any FAT32 partition that you have on your USB stick, so if you have formatted your USB stick to use another type of filesystem or have created multiple partitions on your USB stick, you may want to see the sidebar on “Reformatting a USB Flash Drive,” later in this chapter.

To use this application, do the following after booting from an Ubuntu Desktop CD using the

“Try Ubuntu” option:

1. Select the System ➪ Administration ➪ Startup Disk Creator menu option. A dialog like the one shown in Figure 2-17 displays.

2. Verify that the mountpoint for your Ubuntu Desktop CD is listed and highlighted in the Source disk image (.iso) or CD area at the top of the dialog. If not, click Other and browse to the correct location.

Figure 2-17

Creating a USB startup disk

3. Verify that the USB disk partition upon which you want to create a bootable Ubuntu system is listed and highlighted in the USB disk to use area in the middle of the dialog.

The line below the USB disk list identifies whether the selected USB partition has suf-ficient space for installing a bootable system. If the USB stick that you are using is not formatted, click Format to format it. Once formatting completes, you should see two entries in the “Disk to use” section — one for the stick itself, and one that ends with a number, identifying a specific partition on that stick. Make sure that the entry that ends in a number is selected.

4. To create a bootable USB stick that supports the persistent storage of applications that you install, files and directories that you create, and applications and system configura-tion informaconfigura-tion, make sure that the “Stored in reserved extra space” radio button is selected at the bottom of the dialog shown in Figure 2-17. Drag the slider below this radio button to identify the amount of space that you want to allocate on the selected partition for storing persistent data.

If you do not want to create any persistent storage, click the “Discarded on shutdown”

radio button. If you select this radio button, your bootable USB stick will behave exactly like an Ubuntu Desktop CD. Any files or directories that you create, applications that you install, and application and system configuration information that you modify will not be preserved when you shut down a system that you have booted from the USB stick.