LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-17-2004, 06:20 PM   #1
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Rep: Reputation: 30
Fat32 formatting under linux corrupting under windows?


This is a strange problem, hopefully someone can suggest where it's going wrong.

At my work place, we use a linux box to format 80gb drives with a single 80gb fat32 partition.

I format the drives using:

mkfs.vfat /dev/hdd1 -F 32

Everything formats fine and then I mount an NT share on our network to copy files to the drive.

When I take the drive out of the caddy and install it as a slave drive in our windows XP machine, I can see and read the files. No problem. I can even do a fast check for errors on the drive and no reported problems.

Now, if I create, write or delete a file or folder, not only does the windows machine lock up, but it totally corrupts the drive. Inserting back into linux shows that there is no longer a partition table there.

Anyone come across this before?
 
Old 11-17-2004, 09:12 PM   #2
zaicheke
Member
 
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393

Rep: Reputation: 30
could it be the permissions of the fat 32 drive. I'm not sure if that would affect windows but who knows.
 
Old 11-17-2004, 10:08 PM   #3
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Original Poster
Rep: Reputation: 30
Permissions? I would doubt it, these are just stock fat32 files. And it shouldn't lock up a PC. It may be simply the controller on this PC.
 
Old 11-18-2004, 01:12 AM   #4
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
I formatted an 120 GB hard drive (about 112 GB in machine langauge) as FAT32 in Linux. I did not have to specify 32 because mkfs.vfat automatically detects the capacity and sets up either 16 or 32 for you. It worked fine but I used an USB to IDE bridge and I set the partition type to b. Using a removable hard drive bay to transfer files from one computer and to another is ok but the controller have to stay the same. Also removing a hard drive while the computer is on is very bad for the controller and the hard drive unless its SCSI. Linux is unable to hotplug PATA and SATA, so you have to power down the computer to remove those devices. PATA is not hotpluggable so do not do it.
 
Old 11-18-2004, 01:43 AM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
The reported problem seems strange to me, that's for sure. Have you tried doing the FAT32 format using a Windows box rather than a Linux box? Theoretically what you described should work just fine, but Windows is notorious for only playing nice with other Windows, and considering that a hard drive format is a one-time cost, it might be worth a try just letting Windows do it. Once it's formatted, Linux should be able to read/write to a FAT32 partition without trouble. -- J.W.
 
Old 11-18-2004, 09:28 AM   #6
Bill Gatz
Member
 
Registered: Nov 2004
Location: Cincinnati, Ohio, USA
Distribution: I will have to settle on one sometime...
Posts: 31

Rep: Reputation: 15
Huh....?

I don't think I have a picture of this. I re-read the post a couple of times. It seems that the post talks about "accessing" a share from the network (the post said it is okay and readable), and then taking a hard drive and installing it in the Linux box and writing to it (the drive starts okay and reads fine, but trouble begins when something is written to it).

I am so new to this I have had to make multiple reinstalls in a day due to mistakes I have made, so I obviously don't understand much. My limited understanding causes me to wonder if the NT drives you are working with are Fat 32 or NTFS. The reason I wonder is because you mention Fat 32 as though it is the standard for your office, but if you were using NT in an office setting, you should be using NTFS for the best file security that system can give you. So if you are doing that, then we are talking about an NTFS and Fat 32 combination. (And this could be where I start to get off the track...)

Anyway, this takes me to something I have believed, but don't know if it is true. I always thought you could access, read and copy FROM an NTFS partition while booted into Linux, but I didn't think you could write to the NTFS drive. (I am somewhat embarrased not to know this as fact.) Even if that is incorrect, I wasn't able to tell from the post if you were only writing NT info to the Linux partition, or if you were writing something back to the NT drive (sorry). But if anyone has a primer (preferably a web page) concerning that kind of information (how file systems interact), I would gladly read anything I could. I was surprised at how little material was at my local Borders and B & N bookstores.

So to compound my original newb stupidity, maybe this other thing has something to do with it... I came across it in a forum recently. It was about copying files, and it mentioned that you should break up file copies into small parts due to RAM limitations. Are you copying a huge chunk of the drive at once? If so, does it freeze up even if you break up your operation into smaller parts? (If I am going to be off base, might as well do it twice in one post, right?)
 
Old 11-18-2004, 01:08 PM   #7
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
Linux should be able to easily read from and write to FAT32. Linux currently is capable of reading from NTFS, but writing to NTFS is only in the experimental stages. (In other words, it should not be expected to work.)

Billy Gatz brings up an excellent point - if the drive actually is being formatted as NTFS (or if the XP box is automatically reformatting the drive to NTFS) then any write operations to that drive from Linux could cause problems. It would be helpful to see the results of "fdisk -l" (no quotes, and that's a lower case L) to confirm what file system type is being used. -- J.W.
 
Old 11-18-2004, 05:55 PM   #8
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You can write to NTFS but you need captive-ntfs or buy a commerical NTFS product to write to the drive with out any problems. The kernel's NTFS feature like JW said writting to it is still in its experimental stages. Use either captive-ntfs or a commerical product to access NTFS paritions in Linux.

The only way you can use the secure features of NTFS is secure a directory. Securing only a file will not do you any good because people can see the file and probably hack your password. NTFS has the same security as FAT.

I do not have any trouble copying 80 GB of data from and to a FAT32 partition in Linux. I used the sync option because I want to make sure the data is written to the hard drive just in case something happens. In Windows, you have to rely on it to sync but there is a sync utility at System Internals.
 
Old 11-18-2004, 09:19 PM   #9
Bill Gatz
Member
 
Registered: Nov 2004
Location: Cincinnati, Ohio, USA
Distribution: I will have to settle on one sometime...
Posts: 31

Rep: Reputation: 15
That would explain things if the writes are being done between FAT 32 and NTFS. But after a re re-read, I still wonder if JW was right, and all of this writing is taking place between FAT 32 partitions across (if I read correctly Linux, NT and XP). If so, I would try JW'sl suggestion, that is, to format the drive with fdisk. Then do the same ritual he does to transfer the data and see if that makes any difference.

Someone mentioned the hard drive controllers going bad. Once again, after reading the post, it seemed to me that it is a production environment and I assumed that this happens every time the poster tried to do this. However, if this truly is only happening with one disk, and it has not happened multiple times, the poster definitely needs to see if the problem happens every time, especially if the one disk he has been using is old.
 
Old 11-18-2004, 09:59 PM   #10
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Original Poster
Rep: Reputation: 30
Just to explain why we use FAT 32. These drives do not end up going into computers but in audio play systems using nothing but a firmware that reads fat32 files from a device. So that's why we don't prepare them in NTFS even though our infrastructure is mostly XP.

The joke of the matter is that my windows XP machine can't format the drive as fat 32 at that size. I use the format GUI under windows and there is no option for FAT, only NTFS. And if I use the console with FORMAT C: /FS:FAT32 -q

...it says, cannot format fat32 of that size (or something like that). So linux is a must use. Anyway. I'm trying other drives and another Windows XP machine and see if I can isolate the issue.

I'll report it back for others.
 
Old 11-19-2004, 08:03 PM   #11
Bill Gatz
Member
 
Registered: Nov 2004
Location: Cincinnati, Ohio, USA
Distribution: I will have to settle on one sometime...
Posts: 31

Rep: Reputation: 15
Well, I just made a boot disk in Winders, and it doesn't put fdisk in there. I thought it might, but it didn't. I am sure you can find it on the internet if you look, I know I have it in a couple of places (I just don't remember where I got it). As someone said earlier, use that from a DOS startup disk, format to FAT 32 and see if all happens more peacefully. If you really and truly can't find fdisk anywhere, get tools for the hard drives you have. They either came with new drives, or you can download them at the manufacturers website. I usually end up with Western Digital or Maxtor drives, I usually whatever is on sale, and we use both brands at work. But not having a new drive isn't a problem. Go to the website (if it is a different brand you can probably find the equivalent) but wddiag (or something like that) will do the trick for Western Digital, and Maxblast will do the trick for Maxtor. Those tools will format their own drives to any file system you want, so if you really can't do fdisk, try those and see if they play better with Winders. I would say there is a 50 to 85 percent chance that you will have better luck.
 
Old 11-20-2004, 04:28 AM   #12
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
fdisk is an partitioner. It does not format a hard drive. You have to use a format tool. Windows 2000/XP can not format a partition that is bigger than 32 GB with FAT32. You have to use Win98 or mkdosfs for Windows. You just need to find a Win98 CD and take off fdisk, format, and put it on a DOS boot disk. I think you can squeeze 1.7 MB with a floppy with Linux so you can put hard drive manufactures utilities on it too.
 
Old 11-20-2004, 04:54 AM   #13
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,292

Rep: Reputation: 65
windows is picky about the cluster size on drives. mkdosfs will let you format the vfat filesystem with about any size cluster and linux can read it fine, but windows cannot. try a large cluster size, like 32k.
it may be that windows doesn't support an 80 gig fat32 partition, and that's why it will not let you partition it that big?
 
Old 11-20-2004, 05:31 AM   #14
jchance
Member
 
Registered: Sep 2003
Location: New Hampshire USA
Distribution: Mandriva 2006 & 2007 Power Pack Club
Posts: 178

Rep: Reputation: 30
If you are formatting these drives in a FAT filesystem under linux then hooking them to NT drives to copy files, no offence but you definitly need a clue. 2k and XP will partition and format these drives in FAT32 to the max limits of the file allocation system. I know this for a fact being a former winblows software developer. Why are you waisting time effort and energy this way if I read this right.

For starters if these drives reside on a server and are used for networked file sharing they should be formatted in a filesystem native to the OS. Preferably one best designed to use the full capability of the OS if there are multiple choices. I say that seeing there are a couple of file systems that 2k / xp can use, namely FAT whether 16bit or 32 bit or ntfs. If it is a Winblows filesystem that is 2k or newer always use NTFS. If it is on a linux box DON"T use a Gates introduced filesystem if it isn't a dual boot!! On a linux machine you use a file system such as ext3 or reiserFS, etc.

The network doesn't see what type of filesystem the information is stored on and it seems these drives are there on a network file server from what I am reading, well I think that is the case. If that isn't the case they are paseed from a couple of machines to set them up, then rested into a winblows box. Either way you should keep drive partitioning and formatting in the OS environment you plan on keeping the drive in. so if the drives are for winblows use it to set them up. Same holds true for linux as well.

I hope this helps you out on that one, well atleast for do's and do not's
 
Old 11-20-2004, 11:33 PM   #15
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
I'll saying it again. Windows 2000/XP can read/write FAT32 partitions that are larger than 32 GB. Well it can read/write up to 2 TB, but who is going to bother setting up that size. Windows 2000/XP can not and I'll repeat can not format partitions as FAT32 if the size of the partition is bigger than 32 GB. You have to use eariler Windows versions that does not have this limitation when formatting larger than 32 GB or use mkdosfs. Have look at Microsoft's knowledge base. They stated this very clearly.

http://www.microsoft.com/resources/d...c_fil_tdrn.asp


I do not know why jchance stated always use NTFS for Windows 2000 and Windows XP. This statement is false. Many people use FAT32 for Windows XP because sometimes Windows XP locks files on NTFS making it not boot. I have installed Windows XP on a FAT32 partition with no problems at all. I do not use Windows any more. The only time I use Windows is during troubleshooting someones computer.

The only way corruption will occur is if the controllers are not the same or you remove the drive while it is trying to sync to the drive. Changing the cluster size effects some applications that does not have the right code to handle it for large capacity partitions although decreasing cluster size gives you more space to use. If you have Partition Magic it tells you about this problem when changing cluster size.

BTW, sorry I had to post a microsoft link but nobody will understand what I'm saying if did not.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting very big fat32 partition with Linux Xavius Linux - General 6 10-08-2005 07:53 PM
Formatting failed, now my fat32 windows partition is non-existent. zimzam Mandriva 12 12-28-2004 06:51 PM
Windows corrupting Linux geyes30 Linux - General 2 03-24-2004 08:44 AM
Windows ad Linux "corrupting" each other? Richey General 22 03-07-2004 11:08 PM
Formatting a FAT32 partition... SamH Linux - General 3 12-23-2003 10:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration