Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running Ubuntu from a "Try Ubuntu" file that I downloaded to my USB stick and booted from. Can I mount that very USB stick and write to it while running Ubuntu from it? If so, how?

Edit to clarify: It's not important that settings of applications and such are saved; I'm just looking to save some specific data.

Another edit: I restarted and booted again. This time the USB stick is found (/dev/sdb1) but it is already mounted (read-only) to /cdrom, so I can't mount it again. A file called "README.diskdefines" on the USB stick says that it's Ubuntu 10.10 i386.

share|improve this question
    
You can try remounting rw with sudo mount -o remount,rw /cdrom –  enzotib Jul 26 '11 at 19:02
    
@enzotib: That did it. Thanks! Please put it as an answer. –  Andy Jul 26 '11 at 19:26
    
ok I put it in an answer –  enzotib Jul 26 '11 at 19:43
add comment

3 Answers

up vote 4 down vote accepted

You can remount in read-write mode the partition mounted on /cdrom with the following command:

sudo mount -o remount,rw /cdrom
share|improve this answer
add comment

I have tried to write to my cdrom drive but it requires root permission, which is not really practical as every time I need to write to the folder its mounted to, I have to use sudo/gksu.

After some researching to make the cdrom folder writeable, I realized that the problem here is simple. Data need to be easily shared (both read and write) on both Windows and Ubuntu. So I have changed my approach and use following technique.

  1. Use GParted to have following partition layout on my 8GB USB stick:

    • [ Primary 4GB fat32 label Data flag lba ]
    • [ Logical 710MB fat32 label LiveUSB flag boot/lba ]
    • [ Logical 3.29GB ext4 label casper-rw ] ]

    After I created all partitions, I had to unplug and re-plug the stick so that Ubuntu would remount all partition. I am not sure about the lba flag but I keep it just to be in safer side.

  2. Use usb-creator to put Live USB to 2nd partition which is labeled LiveUSB. I also followed the instructions here and added the word persistent after append in order for the stick to become a real Live USB device.

After booting from the newly created Live USB stick, a mount point Data show up, and I can write to that easily. After booting Windows and putting in the USB stick, I also have a drive labeled Data for me to write to. This fitted my need.

share|improve this answer
add comment

Yes. If you want to, you can make your USB-stick persistent when you create it, which allows you to save settings and save files within Ubuntu. If you are looking to be able to access the files you write to the stick, while NOT running from the stick, you'll need to partition the stick.

More information on both can be found at https://wiki.ubuntu.com/LiveUsbPendrivePersistent

share|improve this answer
    
I've already created the stick and am currently running from it (on a computer without net connection). I don't think it's persistent. I can use it to read/write files while not running Ubuntu from it, both on Windows and Ubuntu. Is it possible in this situation, without creating a new stick? –  Andy Jul 26 '11 at 18:35
    
I don't need to store fancy things like keyboard layout and settings, just a single file. –  Andy Jul 26 '11 at 18:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.