Friday, October 3, 2008

Sharing Files with a USB Drive in Ubuntu

The simplest and most common use for a USB drive is to share files between systems. Dapper supports most USB drives. Simply plugging the drive into the USB port will automatically mount the drive. From there, you can access it as you would access any mounted partition.

Linux, Windows, Mac, and most other systems support FAT file systems. In order to share files with other users, consider formatting the drive with mkdosfs. For example:

1. Install the dosfstools package if mkdosfs is not already installed.
sudo apt-get install dosfstools

2. Unmount the drive (for example, /dev/sda1) if it is currently mounted.
sudo umount /dev/sda1

3. Format the drive using either FAT16 or FAT32.
mkdosfs -F 16 /dev/sda1 # format FAT16
mkdosfs -F 32 /dev/sda1 # format FAT32

If you do not mind restricting file sharing to Linux-only systems, then you can format the drive using an ext2 or ext3 file system using any of the following commands:

mkfs /dev/sda1 # default format is ext2
mkfs -t ext2 /dev/sda1 # explicitly format type as ext2
mkfs -t ext3 /dev/sda1 # explicitly format type as ext3
mkfs.ext2 /dev/sda1 # directly call format ext2
mkfs.ext3 /dev/sda1 # directly call format ext3

Many thumb drives have a light to indicate that the drive is being accessed. Even if the drive is not mounted, do not unplug the drive until the light indicates all activity has stopped.

If you want to create a FAT-formatted USB floppy drive, then use the -I option. For example: sudo mkdosfs -I -F 32 /dev/sda.

Source of Information : Hacking Ubuntu Serious Hacks Mods and Customizations

No comments: