How to create a filesystem mountable by windows in linux?

I have attached an external USB disk to my debian gnu/linux system. The disk showed up as device /dev/sdc, and I prepared it like this:

  • created a single partition withfdisk /dev/sdc (and some more commands in the interactive session that follows)
  • formatted the partition withmkfs.msdos /dev/sdc1

If I then attach the USB disk to a Windows XP or Vista system, then no new drive becomes available. The disk and its partition show up fine in the disk managment tool under "computer management", but apparently the file system in the partition is not recognized.

How do I create a FAT32 file system which can actually be used in windows?

edit: I've given up on this and went with a NTFS file system created by windows. In debian lenny this can be mounted read-write but apparently it requires you to install the "ntfs-3g" package and explicitly pass the -t ntfs-3g option to the mount command.

4

4 Answers

You should probably delete MBR before repartitioning. In other words:

dd if=/dev/zero of=/dev/sdc bs=512 count=1

If you want a GUI, I would recommend using Gparted (link to Live cd - however, it is in most repositories) - it works very well.

With Gparted, you can create, delete, move and change partitions and file systems - very easily.

You can create/format to NTFS or Fat32 using this which should both be Windows and Linux compatible.

I believe mkfs.msdos creates a FAT filesystem (the one with 8.3 file naming conventions).

Its mkfs.vfat that creates a FAT32 filesystem which is accessible from Windows too (since I've tried this). And it supports long filenames.

1

The point of being linux and windows compatible is doing this:

dd if=/dev/zero of=/dev/sdc bs=512 count=1
(echo o; echo n; echo p; echo 1; echo; echo; echo t; echo b; echo w) | fdisk /dev/sdc

Note "echo b" is choosing: "W95 FAT32" Device Type

you can check it doing:

fdisk -l /dev/sdc

you should read:

Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 976766975 976764928 465.8G b W95 FAT32

Choosing "echo b" worked for me. The disk was checked and worked well under windows XP, windows 7, unix (i dont tried under mac but FAT32 normally works)

Somebody tried "echo c" to get "W95 FAT32 (LBA)" device type but it dont worked for me

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like