What is the right way to mount and umount a usb driver?

I have some questions:

1, I successfully mounted my usb drive with "sudo mount /dev/sdb1 /mnt", but I can't wirte, It says "read-only file system". But I can write it in windows.
2, After I umounted the usb drive the led of it still on, but not blinking. Is it safe to unplug it? How to let it's led off?
3, What is the right way to mount and umount a usb dirve in linux?

Thank you.

What filesystem is the USB drive formatted with? The default Linux driver only has read-only access to NTFS filesystems.

The behavior of the USB drive's LED isn't always the same even between different versions of Windows! If the drive has finished unmounting, it's safe to remove.

u can unmount it using following command.

#umount /mnt

or

#umount /dev/sdb1

and also check the fs. linux will take fat or ext only by default

@Corona688

The file system is FAT32.

Is it necessary use 'sync' command before umount?
Is it necessary use 'eject' command after umount?

Odd... I don't know why it's mounting it as read-only.

It's entirely possible that you just don't have permissions to access it, though. FAT32 has no owners or groups, so it just assumes root. Try mount -o uid=myuid,rw -t vfat /dev/whatever /path/to/dir where 'myuid' is your user id like in /etc/passwd.

Nope, umount sync's by itself. umount by itself leaves a drive in a state that's safe to shut down or remove or what have you.

Nope. eject just an extended umount that ejects the tray when it's done syncing and unmounting -- which only makes sense for things that have a tray, like cdrom drives.

Nope. no need for sync and eject.

Thank you. I know the reason, it's my usb dirve's fault. It goes wrong sometimes. After I mount it, it is writable, but some seconds later it isn't.

Another question: Why my usb drive has sdb and sdb1, while another usb drive has only sdb?

If a partition stops being writable, it's probably having disk errors of some sort. You may see relevant error messages with dmesg | less

The sdb/sdb1 difference isn't from different kinds of drives, it's because of their contents. Some flash-drives come formatted like old-fashioned floppies -- no partition table. These just show up as /dev/sdb. Others come formatted with a partition table, like hard drives usually do, and show up as /dev/sdb + /dev/sdb1. /dev/sdb is the raw disk, /dev/sdb1 is the first partition.

It's possible to have more than one partition on a flash drive, just like any other block device can, but Windows doesn't support this very well.

Thank you, guru Corona688.

BTW, My fedora 15 on GNOME3 have a right-click menu "remove device safely", after I click it, the LED of the usb drive is off. How to let the LED off after I umount the usb drive in console?

Again, the behavior of the light is hardware and OS dependent. Not even all versions of Windows turn the light off for all models of USB drives. Once umount has successfully finished it's safe to remove the drive, period.

On some drives, using eject instead of umount will turn the light off. Again, this isn't universal.

But I am using the same OS and the same hardware. What is diffrent is the console and GNOME. I am wondering what GNOME done to let the LED off? Not eject, it dosen't turn off the LED on my OS.

Other people have reported the opposite experience as you: eject turning the LED off and gnome not turning the LED off.

It's hardware and OS dependent.

---------- Post updated at 10:00 AM ---------- Previous update was at 09:53 AM ----------

You are running eject as root, yes?

yes.

Then what?

What do you mean?

Yes, I am running as root. But what is the ralationship between root and the LED? What I am concerning is the LED.

Filesystems which are mounted as 'user' may not have permissions to do anything beyond unmounting the filesystem.

I see.