LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Write to USB Drive from Linux then Reading from MS Windows (https://www.linuxquestions.org/questions/linux-newbie-8/write-to-usb-drive-from-linux-then-reading-from-ms-windows-447076/)

KirkCuth 05-21-2006 01:50 PM

Write to USB Drive from Linux then Reading from MS Windows
 
Hello,
I've been trying Linux Redhat and Mandrake/Mandriva over past 5 years, but never starting using as I could never get them to read and use my USB peripherals.

Recently I got the SimplyMepis bootable CD from Linux Format magazine and was happy that it booted properly and could read my
512Mb USB pen drive that I wrote to from MS Windows XP.

I just tried dragging and dropping a file to the pen drive and it didn't seem to want to write to the pen drive. I'm doing this in Mepis as an ordinary user demo.

1) Do I have to have root privileges to write to a USB drive?

2) If I do manage to write to the USB drive, will I still be able to read from it in WinXP?

Thanks for helping me to clarify this. This is one of the issues
that has kept me from using Linux as my main OS.

Have a great day,

ninjabob7 05-21-2006 02:08 PM

One thing you should know about Linux and WinXP is filesystems. Linux uses the ext2 and ext3 filesystems natively, and also supports reiserfs and some others. None of these can be read by Windows without some extra tools.

Windows XP can read several filesystems:
FAT12 (also called MSDOS, readable and writable on Linux)
FAT16 (r/w on Linux)
FAT32 (r/w on Linux)
NTFS (read-only on Linux)

FAT16 and 32 are called VFAT on Linux.

Windows XP is normally installed on NTFS. Windows 95, 98, and ME use FAT32. Most USB drives and flash cards are formatted with FAT16.

Most livecd's (such as Knoppix) won't let you write to any Windows-format drive normally. In KDE, you can right-click the drive icon, click Properties, find the Read Only option (I think on the last tab) and uncheck it. Make sure the drive is unmounted when you do this. After that, you shouldn't need root priveleges.

And yes, Windows will be able to read the files.

monty_2487 05-21-2006 02:27 PM

I too have tried to use a usb drive in linux and windows. I have found that on my sys (Mandriva) I have to unmount, go into the config program and id the drive under the partition manager. Then I have to go into properties and tell the drive that all users have read/write privilages. This is painstaking to do everytime, and it is easier (for me) to re-format the jump drive to FAT32 so I can use it in both XP and linux

David the H. 05-21-2006 02:37 PM

Most LiveCD's only mount filesystem devices as read-only by default. You'll have to change this to read-write. I don't know if Mepis has a simple way to do this, but Knoppix provides a right-click menu item on the desktop icon for it, so look there first.

If there isn't anything like that, then you'll have to run the mount command as root:

mount -o remount,rw /dev/sda1

where...

"-o" indicates mount options.

"remount" changes the status of a mounted disk without unmounting first (omit this if you're mounting for the first time).

"rw" is read-write (change to ro for read-only).

"/dev/sda1" is either the device name or the mount point of your usb drive. You could substitute /mnt/sda1 or /media/sda1, depending on where it's mounted. Check the drive properties for the actual device name.

You should now be able to write files to the drive. If it's anything like Knoppix, you should even be able to do it as a normal user. But you'll still need to have root priveleges to change the mount options.

Nearly all flash drive use the FAT32 file system, so there should be no problem accessing it from Windows. You may have some trouble though if you use non-English filenames. Most Linux distributions these days use UTF8 encoding, but Windows mostly still uses older country-specific encodings. To work with them you'd have to add two more options to mount: "iocharset=utf8" (assuming Mepis is UTF8, type "locale" to check), and "codepage=1234", with the number being that of your language's codepage. A more detailed explanation can be found here. Since you indicate that you are in Malasyia though, you shouldn't have to do this, since Malay uses the same codepage as English (1252).

If you ever install Linux permanently, then you'll be able to set the options permanently through the /etc/fstab file. You might even give it a try on the liveCD, since many of them allow you to save such changes to your hard drive or a removable disk.

ninjabob7 05-21-2006 03:49 PM

Quote:

Originally Posted by David the H.
If there isn't anything like that, then you'll have to run the mount command as root:

mount -o remount,rw /dev/sda1

Actually, I don't think that works on Knoppix. At least not mounting it from scratch. I've never tried the remount option (I only found out about it a few days ago.) And I thought I was an experienced user...

David the H. 05-21-2006 04:50 PM

Yes, it does work on Knoppix. I have a second computer running it now, and I tested it before I posted.


All times are GMT -5. The time now is 03:55 PM.