Sharing Files Between Ubuntu Flash Drive and Windows

本文将指导您修改Casper脚本来允许Ubuntu闪存驱动器的默认用户在读写方面获得全盘访问权限。完成此操作后,您将能够在Ubuntu下保存文件到闪存驱动器的根目录,并从Windows或Linux访问这些文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I find run ubuntu usb install drive is very good, no need to install. But in order to utilize the full capacity of USB drive, the following article tell the way.


http://www.pendrivelinux.com/sharing-files-between-ubuntu-flash-drive-and-windows/


Sharing Files Between Ubuntu Flash Drive and Windows

How to Share Files Between your USB Ubuntu Flash Drive install and Windows. In the following tutorial, you will learn how to modify the casper script to allow you to mount your USB Flash Drive as read/write. By default casper only allows the root user to gain full access to the drive, preventing the live user from saving files back to the fat formatted device. This tutorial allows for the default Ubuntu user to also have the same read and write access.

Upon completion, you will be able to save files back to the root of your Flash Drive (mounted as /cdrom) while your running from Ubuntu. Save your documents, photos, movies, mp3's, special configuration files etc… back to the Flash drive. In addition you can add files while running from Windows and then access those files again while running from Linux or vice versa.

The following solution should work on Ubuntu, Kubuntu, Linux Mint, and other "Ubuntu 10.04/10.10". based compilations.

Updated 11/23/2010 Works with Ubuntu 10.04/10.10

How to edit the Casper script to allow read and write access to the entire USB device:

  1. Boot from your previously created USB Ubuntu Flash Drive
  2. Open a terminal and type sudo su (to become root)
  3. Type mkdir /projectaccess (to make our project directory)
  4. Type cd /projectaccess (to change to the project directory)
  5. Type lzma -dc -S .lz /cdrom/casper/initrd.lz | cpio -id (to extract the initrd.lz)
  6. Type gedit scripts/casper (to edit the casper script)
  7. From gedit, find the following section of code:

    home_snapshot_label="home-sn"

  8. Just below it add the following code:

    mountmode="ro,noatime"

  9. Now find the following section of code:

    IGNORE_UUID="Yes" ;;

  10. Just below it add the following code:

    # New command line parameter to select the base device mount mode
    basemountmode=*)
    mountmode="${x#basemountmode=}";;

  11. Now find the following section of code:

    if is_supported_fs ${fstype}; then

  12. and (as a single line of code) change the first occurrence of mount line to:

    mount -t ${fstype} -o ${mountmode} "${devname}" $mountpoint || continue

  13. Save the file and return to the open terminal
  14. From the terminal type find . | cpio -o -H newc | gzip -9 > initrd.lz (to zip the new initrd.lz file)
  15. Type cp initrd.lz  /cdrom/casper
  16. Type gedit /cdrom/syslinux/txt.cfg ( text.cfg if using Ubuntu 10.04)
  17. On the first append line, replace the following section:

    initrd=/casper/initrd.lz

  18. With the following section (as a single line):

    initrd=/casper/initrd.lz basemountmode=ro,noatime,uid=999,gid=999

  19. Save the file and exit the editor
  20. Reboot your computer and proceed to boot from your USB Flash Drive again

If all goes well, you should now be able to save files to /cdrom (the root of your Flash Drive) from within Ubuntu and access those files from within Linux or Windows.

Kudos goes out to Julian Chennales who submitted the base information for this fix to pendrivelinux for posting.

Ubuntu is a product of Canonical Ltd.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值