Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-23-2014, 10:41 AM
|
#1
|
LQ Newbie
Registered: Apr 2014
Posts: 6
Rep:
|
corrupted ntfs partition table on usb drive
Hi all, first post here. I'm setting up a backup system based on Raspberry Pi and an external 2TB USB drive. A cron will drive rsync backup from my NAS. As I have to transfer in excess of 200GB of data I had formatted my USB drive with NTFS and have ntfs-3g on the Raspian box (Debian Wheezy optimised for arm processor) with the intention of using my Windows 7 PC to populate the USB drive via USB3 (complex set up - don't ask ).
It was working fine until I shut down the Raspian box and removed the USB drive (didn't umount first). The consequence of this was a corrupted ntfs partition table that neither Windows 7 PC nor any of my linux boxes could fix. Nothing is lost but I'm reluctant to repeat this and might take the pain of slow network transfer and just go ext4 for the USB drive. It just means I can't use it as a portable drive for a Windows laptop when I'm away.
The real question though, is ntfs-3g not reliable enough to use, or should I have unmounted the drive before shut-down, or is this just a one-off bad luck occurrence? Given how slow the Raspberry Pi is it is possible it hadn't quite finished shut down before I unplugged the USB drive a minute or two later.
|
|
|
04-23-2014, 03:18 PM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,099
|
I never had problems with vfat (well I did, but I deserved them).
It doesn't have the security hangups that ntfs has. Tools fairly good in both systems.
|
|
|
04-23-2014, 04:23 PM
|
#3
|
Moderator
Registered: Mar 2008
Posts: 22,184
|
I don't get the windows 7 populate and ntfs-3g deal. Where is the flash drive installed at?
|
|
|
04-23-2014, 04:36 PM
|
#4
|
LQ Newbie
Registered: Apr 2014
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by jefro
I don't get the windows 7 populate and ntfs-3g deal. Where is the flash drive installed at?
|
No, I spared you all the details. My NAS is 2TB. At the moment a Windows PC runs a winscp script as a daily batch job that copies NAS data to a 750GB external USB. That is the one I was going to use to initialise the new 2TB USB drive which will afterwards be connected to the Raspberry Pi and which will take over the NAS backup function. Then the 750GB USB drive will be re-deployed elsewhere. So really it's a one-off data transfer to get the 2TB backup disk sync'ed with the NAS 2TB drive. Then *if* I can use ntfs on the backup drive, I have the added bonus of being able to transport my media files with me when I travel, having access only to a Windows laptop. Hope this clears it up
Some of us lead (over)complicated lives
|
|
|
04-23-2014, 05:24 PM
|
#5
|
Moderator
Registered: Aug 2002
Posts: 26,366
|
I'm not familiar with the Pi but I would assume that all file systems will be automatically unmounted during the shutdown process. If you are not waiting until the Pi is completely shutdown then it is possible to corrupt the drive.
If you can't wait to unplug drive until the Pi is shutdown then I would manually unmount it. Be sure to close any applications that are currently access the device as well as terminal windows where its working directory are pointing to the drive.
|
|
1 members found this post helpful.
|
04-23-2014, 05:30 PM
|
#6
|
LQ Newbie
Registered: Apr 2014
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by michaelk
If you are not waiting until the Pi is completely shutdown then it is possible to corrupt the drive.
|
OK, so I am not more likely to suffer a disk corruption using ntfs-3g than ext4. Both are equally likely to become corrupted by premature removal of disk? In other words, my partition table damage was more likely due to premature disk disconnection than ntfs-3g issues?
|
|
|
04-23-2014, 05:38 PM
|
#7
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,286
|
User error. Writes are bufferred, and depending on the filesystem, possibly journalled as well. If you disconnect a drive during update, data has a very high chance of corruption. This is why power drops can have the same effect.
Always umount. For something like this I'd manually umount and not rely on shutdown scripts - they have been known to be impatient ...
|
|
1 members found this post helpful.
|
04-23-2014, 05:40 PM
|
#8
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,286
|
Do you have evidence of partition table damage, or are you simply mis-interpreting filesystem corruption in NTFS ?.
|
|
|
04-23-2014, 05:54 PM
|
#9
|
Moderator
Registered: Aug 2002
Posts: 26,366
|
I agree with syg00 and would not expect the partition table to be corrupted. Since we do not know how the drive is partitioned and with out knowing the exact error messages we can not say.
Typically NTFS would complain of a dirty of unclean shutdown. Any open files could become corrupted as well as losing data that was pending to be written to disk. As stated no different then ext filesystems.
|
|
1 members found this post helpful.
|
04-24-2014, 03:56 AM
|
#10
|
LQ Newbie
Registered: Apr 2014
Posts: 6
Original Poster
Rep:
|
I can't remember the exact message, something about the possibility of fake raid, running chkdsk /f and mounting windows twice (seemed an odd remark). My browser search history shows I was looking for way to mend a corrupt master file table. Anyway, several attempts at chkdsk /f and fsck on both Win7 & linux boxes failed to fix it and returned essentially the same corrupt file table message. No real harm done as the files were backups and I was just testing the drive. I'm just anxious to avoid a repeat when it goes into deployment.
michaelk: drive was a single ntfs partition on a 160GB USB drive (was testing the arrangement on an old drive) formatted to ntfs using gparted.
Last edited by valerian; 04-24-2014 at 04:04 AM.
Reason: clarity and to reply to drive format question
|
|
|
04-24-2014, 04:16 AM
|
#11
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,286
|
Ok, that's filesystem corruption.
Make sure it's umount'd properly and you should be fine - NTFS, ext4, FAT32, whatever.
|
|
|
04-24-2014, 12:03 PM
|
#12
|
LQ Newbie
Registered: Apr 2014
Posts: 6
Original Poster
Rep:
|
Just for the record, I've opted for ext4 as nfts had really poor write speeds (assessed by time sh -c "dd if=/dev/zero of=/mnt/backup/ddfile bs=8k count=30000 && sync") and exfat caused errors with some of the rsync opts (file permissions - chgrp "/some/file" failed: Function not implemented ). Probably best to stay with 'native' filesystem anyway. Thanks everyone for the assistance.
|
|
|
All times are GMT -5. The time now is 08:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|