ntfs drive with error - questions - knowlege gathering

General support questions
Post Reply
lightman47
Posts: 1154
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

ntfs drive with error - questions - knowlege gathering

Post by lightman47 » 2020/05/26 17:08:45

I've begun getting emails from my 'movie' machine that read: "Device: /dev/sdc [SAT], 1 Currently unreadable (pending) sectors". It is formatted NTFS and mounted in CentOS 7 as such. I've since regretted that format decision, but know why I did it. Frustrating is that the drive is ~2 years old and really doesn't run a lot as the machine is off 95% of the time - but smartd reports a couple entries as 'pre-fail' and most as old age.

OK. As it happens, the 4tb drive is a regularly synced "mirror" of one on another network machine, so wiping & copying in data is my plan, until the drive actually becomes more problematic. After wiping I'll likely format either ext4 or xfs. In the meantime, I'll order a new drive.

Questions:
1. Can I use 'dd' to ZERO the drive? (I expect something like 'dd if=/dev/null of=/dev/sdc')

2. If I do, is that dd level low enough to erase the NTFS format (my intent)?

3. Will this procedure "get rid" of the bad spot (via reallocation, I presume/hope)?

Thank you.
Remember - importing/building packages will likely "byte you in the butt" come update time, long after you'd forgotten you did that! Use repos whenever possible.

tunk
Posts: 723
Joined: 2017/02/22 15:08:17

Re: ntfs drive with error - questions - knowlege gathering

Post by tunk » 2020/05/26 19:51:44

1. Yes, just be sure you select the correct disk.
2. Yes.
3. Don't know. It may be more likely if you use badblocks -svw

lightman47
Posts: 1154
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: ntfs drive with error - questions - knowlege gathering

Post by lightman47 » 2020/05/26 19:55:58

Excellent!
Thank you!
Remember - importing/building packages will likely "byte you in the butt" come update time, long after you'd forgotten you did that! Use repos whenever possible.

pjsr2
Posts: 476
Joined: 2014/03/27 20:11:07

Re: ntfs drive with error - questions - knowlege gathering

Post by pjsr2 » 2020/05/27 08:40:56

The first and last sectors of a disk contain its size information. Zero-ing these may not be so smart.
Better to zero the partition, like in 'dd if=/dev/null of=/dev/sdc1'. Replace 1 by the relevant partition number.

User avatar
TrevorH
Forum Moderator
Posts: 28867
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ntfs drive with error - questions - knowlege gathering

Post by TrevorH » 2020/05/27 08:55:24

"Device: /dev/sdc [SAT], 1 Currently unreadable (pending) sectors".
So... this means that the drive has a sector (possibly more than one) that the drive has detected as failing and it has marked it as needing to be replaced. It won't actually replace it until the next time it is written so you have to get something to write to that sector so that the drive will replace it from its list of internal spares. You can use badblocks which can be told to read and write back every sector on the drive and that will fix this report and also preserve the current data on the drive (assuming it doesn't die completely while doing it). Or you can dd over the entire drive and restore the data - which might end up being quicker!

The error isn't to do with NTFS, it's hardware related.

How do the other smartctl -a stats look?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

lightman47
Posts: 1154
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: ntfs drive with error - questions - knowlege gathering

Post by lightman47 » 2020/05/27 12:01:45

What I wound up doing was using the disks gui app to format the drive as ext4 (overwriting the data). It said it would take 20+ hours. When I got up this morning it had completed and there was a pop-up about an error writing to the drive. Behind the pop-up, the disks utility now reported the drive was OK, but with 1024 bad sectors (I think it was sectors). I then ssh'd in and am currently copying in the contents of the 'mirrored' drive on my server. I expect that will take most of the day. As I recall, I think that's about 2.5 GB of data.

When I get back home later I'll be ordering a new drive.

Thank you all!
Remember - importing/building packages will likely "byte you in the butt" come update time, long after you'd forgotten you did that! Use repos whenever possible.

lightman47
Posts: 1154
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: ntfs drive with error - questions - knowlege gathering

Post by lightman47 » 2020/05/27 12:59:26

Well - I lost the drive!!! Heh. Even mkfs choked. Thanks for the help!

Code: Select all

# mkfs -t ext4 /dev/sdc
mke2fs 1.42.9 (28-Dec-2013)
/dev/sdc is entire device, not just one partition!
Proceed anyway? (y,n) y
Warning: could not erase sector 2: Attempt to write block to filesystem resulted in short write
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244195328 inodes, 976754646 blocks
48837732 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3124756480
29809 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done                            
Warning: could not read block 0: Attempt to read block from filesystem resulted in short read
Warning: could not erase sector 0: Attempt to write block to filesystem resulted in short write
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:     0/29809
Warning, had trouble writing out superblocks.
Remember - importing/building packages will likely "byte you in the butt" come update time, long after you'd forgotten you did that! Use repos whenever possible.

pjsr2
Posts: 476
Joined: 2014/03/27 20:11:07

Re: ntfs drive with error - questions - knowlege gathering

Post by pjsr2 » 2020/05/27 17:44:37

You first have to partition the drive. There are several tools for creating partitions. You can do that for example with parted. See https://www.tecmint.com/create-disk-par ... -in-linux/
If you want a single partition, just make one partition that spans the whole disk.

After that you can create file system on the drive with mkfs -t ext4 /dev/sdc1

Post Reply

Return to “CentOS 7 - General Support”