# Storing and reading PDF files on live CD

I want to boot from live CD and use it without installing it. All I want to do is connect to the internet and read couple of PDF and word documents.

Is it possible to write specific PDF files I want to read to live CD? I mean, after I boot of live CD I should be able to see PDF files. I don't want them saved to my hard disk on computer. I want to have all documents I want on live CD itself.

Is this possible?

-
Instead of a CD would you be open to using a USB stick with the Ubuntu LiveCD on it or running a LiveCD with Persistant Storage(e.g., USB drive)? If so, check out - Ubuntu Community Documentation - LiveCD Persistance –  nitstorm Dec 18 '11 at 15:03
It is possible to remix a Live-CD to add your files...but it's complicated and lengthy. The Live-CD is a compressed snapshot of a system, which means you'll need to learn how to create a snapshot, compress it, and image it. A persistent-live-USB is a much simpler solution if it meets your needs. –  user535733 Dec 18 '11 at 23:00

You need to boot off a LiveUSB or use a thumb-drive or external drive in conjunction with your LiveCD if you want to be able to write extra files and use it everytime with the LiveCD.

Alternatively, you can also use the usb-creator program and create a LiveUSB and then allocate some space on the USB drive to use as storage space which you can use to save your .pdf's and Word files.

The detailed instructions to use persistent storage are here at Ubuntu Community Documentation - Live CD Persistence

Excerpt from the Source:

If you are using a USB stick, you need to partition and format your USB stick -

Partitioning:

To partition your USB Stick we will use the command fdisk so run the following command to start the process (replacing /dev/sda with your device path):

sudo fdisk /dev/sda


Without getting in depth about how to use fdisk (which is outside the scope of this document) here is how you can partition your USB by deleting any existing partitions and creating one new partition.

First type “p” at the command prompt and hit to print the current partition table. The output of this command should look something like this:

Command (m for help): p

Disk /dev/sda: 130 MB, 130023424 bytes
16 heads, 32 sectors/track, 496 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

Device   Boot    Start         End      Blocks   Id  System
/dev/sda1   *        1         496      126960    6  FAT16


Again, for this example, we will just delete all of the existing partitions so now type “d” at the command prompt. Then enter the number of the partition you wish to delete. Repeat this process for each partition on your USB Stick until they are all deleted. The following is a example of what your session might look like:

Command (m for help): d
Partition number (1-4): 1

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Selected partition 4

Command (m for help): p

Disk /dev/sda1: 130 MB, 130007040 bytes
16 heads, 32 sectors/track, 495 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

Device Boot      Start         End      Blocks   Id  System

Command (m for help):


As you can see we have now deleted all of the partitions on our USB Stick. Now we can create one new partition by typing “n” at the command prompt followed by your desired partition number. Once that is done type “w” and hit to write the partition table changes to your USB Stick. Here is the output from my session:

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-495, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-495, default 495):
Using default value 495

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument. The kernel still uses the old table. The new table


will be used at the next reboot. Syncing disks.

Now that we have our partition table all set let's format it.

Creating the "casper-rw" File System

Formatting your USB Stick is also a very simple task. First we will unmount the device so we can format it, then just format it.

First unmount your USB Stick by running the following command:

sudo umount /dev/sda1


Now that your USB Stick is unmounted we can format it. The only special consideration is that we must give the formatted partition the label “casper-rw”. This is the name the Live CD looks for to store persistent information. You can properly format your USB Stick by issuing the following command:

sudo mkfs.ext3 -b 4096 -L casper-rw /dev/sda1 The output of this command should look something like this:

mke2fs 1.38 (30-Jun-2005)
Filesystem label=casper-rw
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
31744 inodes, 31740 blocks
1587 blocks (5.00%) reserved for the super user
First data block=0
1 block group
32768 blocks per group, 32768 fragments per group
31744 inodes per group

Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or 180 days, whichever comes first.  Use tune2fs -c or -i to override.

-