LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Can't mount ntfs partition after recompiling the kernel (https://www.linuxquestions.org/questions/linux-kernel-70/cant-mount-ntfs-partition-after-recompiling-the-kernel-4175441938/)

usr345 12-18-2012 04:52 AM

Can't mount ntfs partition after recompiling the kernel
 
I use Slackware 14.0 with native kernel. Then I compiled and installed the new one: 3.7.0. But after recompiling, one of NTFS partitions has disappeared:

/dev/sdc1

While 2 other NTFS partitions are visible and mounted correctly:

/dev/sda1
/dev/sdb1

When loading the old kernel, the partition is visible and mounted. So, I did something wrong with the kernel. But I included NTFS support, otherwise 2 other partition will be invisible.

What can be wrong?

Ser Olmy 12-18-2012 05:08 AM

Is the entire drive (/dev/sdc) missing, or just the partition (/dev/sdc1)?

usr345 12-18-2012 05:30 AM

Just the partition.

Ser Olmy 12-18-2012 06:31 AM

That is a bit odd, as it indicates a problem with parsing the partition table.

If /dev/sdc has a GPT partition table or has been converted to a "Dynamic Disc" in Windows, things like this can happen. However, both these partitioning schemes always contain at least one regular MBR partition, so I would expect to see /dev/sdc1 anyway.

What's the output of fdisk -l /dev/sdc when you're running the new kernel?

usr345 12-18-2012 07:01 AM

root@pc:/# fdisk -l /dev/sdc

Code:

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x75dc8181

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1  *          63  976768064  488384001    7  HPFS/NTFS/exFAT

It is there. But no file sdc1 in /dev directory:
Code:

root@pc:/dev# ls -l ./sdc*
brw-rw---- 1 root disk 8, 32 Dec 18 16:57 ./sdc


Ser Olmy 12-18-2012 07:14 AM

That looks like a perfectly ordinary MBR partition, and there's no good reason I can think of for udev not to create a device node.

Can you mount the partition if you create the device node manually? (mknod /dev/sdc1 b 8 33 & chown root:disk /dev/sdc1)

jschiwal 12-18-2012 07:36 AM

You may want to look at the kernel messages.

What does "sudo file -s /dev/sdc1" say.
Does running "sudo kpartx -v" add the device node.

usr345 12-18-2012 02:49 PM

Quote:

Originally Posted by jschiwal (Post 4851793)
You may want to look at the kernel messages.

Seems, that I found something:

Code:

root@pc:/usr/src/linux# dmesg | grep sdc
[    1.206645] sd 3:0:1:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    1.206825] sd 3:0:1:0: [sdc] Write Protect is off
[    1.206895] sd 3:0:1:0: [sdc] Mode Sense: 00 3a 00 00
[    1.206932] sd 3:0:1:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.392541] sd 3:0:1:0: [sdc] 
[    1.392675] sd 3:0:1:0: [sdc] 
[    1.393912] sd 3:0:1:0: [sdc] 
[    1.394092] sd 3:0:1:0: [sdc] CDB:
[    1.394633] end_request: I/O error, dev sdc, sector 0
[    1.394703] Buffer I/O error on device sdc, logical block 0
[    1.567532] sd 3:0:1:0: [sdc] 
[    1.567665] sd 3:0:1:0: [sdc] 
[    1.568897] sd 3:0:1:0: [sdc] 
[    1.569077] sd 3:0:1:0: [sdc] CDB:
[    1.569616] end_request: I/O error, dev sdc, sector 0
[    1.569685] Buffer I/O error on device sdc, logical block 0
[    1.578837] Dev sdc: unable to read RDB block 0 <-- ?
[    1.578962]  sdc: unable to read partition table
[    1.579612] sdc: detected capacity change from 0 to 500107862016
[    1.580043] sdc: detected capacity change from 0 to 500107862016
[    1.580375] sd 3:0:1:0: [sdc] Attached SCSI disk

How to restore the partition table?

---------- Post added 12-18-12 at 03:49 PM ----------

Quote:

Originally Posted by Ser Olmy (Post 4851777)
That looks like a perfectly ordinary MBR partition, and there's no good reason I can think of for udev not to create a device node.

Can you mount the partition if you create the device node manually? (mknod /dev/sdc1 b 8 33 & chown root:disk /dev/sdc1)

no, doesn't mount

Ser Olmy 12-18-2012 03:10 PM

Quote:

Originally Posted by usr345 (Post 4852166)
Code:

[    1.394092] sd 3:0:1:0: [sdc] CDB:
[    1.394633] end_request: I/O error, dev sdc, sector 0
[    1.394703] Buffer I/O error on device sdc, logical block 0
[    1.567532] sd 3:0:1:0: [sdc] 
[    1.567665] sd 3:0:1:0: [sdc] 
[    1.568897] sd 3:0:1:0: [sdc] 
[    1.569077] sd 3:0:1:0: [sdc] CDB:
[    1.569616] end_request: I/O error, dev sdc, sector 0
[    1.569685] Buffer I/O error on device sdc, logical block 0
[    1.578837] Dev sdc: unable to read RDB block 0 <-- ?
[    1.578962]  sdc: unable to read partition table
[    1.579612] sdc: detected capacity change from 0 to 500107862016
[    1.580043] sdc: detected capacity change from 0 to 500107862016
[    1.580375] sd 3:0:1:0: [sdc] Attached SCSI disk

How to restore the partition table?

You say you can still access the drive if you reboot and select the older kernel, right? That means there's nothing wrong with the drive and any attempts to "repair" the partition table is likely to cause data loss.

This could be a problem with the SATA controller driver. Could you post the output of lspci -v?

jschiwal 12-18-2012 09:06 PM

RDB stands for either Receive Data Buffer or Rigid Disk Block. It may be assuming it is an Amiga disk before continuing trying to check for an MBR on the disk.

However IO errors could indicate a flakey drive. Boot up with the old kernel and check the messages again.

NTFS is not a good choice for Linux. If you are not dual-booting or using an external drive and sharing with a Windows machine, then back up the files and restore to a Native linux file system. The ntfs repair tool only fixes simple errors and marks the drive as needing checking when you boot to windows.

usr345 12-19-2012 01:45 AM

Quote:

Originally Posted by Ser Olmy (Post 4852183)
This could be a problem with the SATA controller driver. Could you post the output of lspci -v?

From the long list of pci devices I selected the disc controller. The second controller is missing in the list.

Code:

00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 IDE Controller (prog-if 80 [Master])                                                                   
        Subsystem: Elitegroup Computer Systems Device 1815                       
        Flags: bus  medium devsel, latency 128, IRQ 11                     
        [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8]         
        [virtual] Memory at 000003f0 (type 3, non-prefetchable) [size=1]         
        [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8]         
        [virtual] Memory at 00000370 (type 3, non-prefetchable) [size=1]
        I/O ports at 4000 [size=16]
        Capabilities: [58] Power Management version 2
        Kernel driver in use: pata_sis

Quote:

Originally Posted by jschiwal (Post 4852421)
NTFS is not a good choice for Linux. If you are not dual-booting or using an external drive and sharing with a Windows machine, then back up the files and restore to a Native linux file system.

I have dual boot, under Windows this partition works fine. Also it contains very important information. And you said, it may start to corrupt. How to check the drive health? I'd better make a backup.

Quote:

Originally Posted by jschiwal (Post 4852421)
Boot up with the old kernel and check the messages again.

Code:

root@pc:/# dmesg | grep sdc
[    1.855220] sd 3:0:1:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    1.855418] sd 3:0:1:0: [sdc] Write Protect is off
[    1.855489] sd 3:0:1:0: [sdc] Mode Sense: 00 3a 00 00
[    1.855530] sd 3:0:1:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.865810]  sdc: sdc1
[    1.866703] sd 3:0:1:0: [sdc] Attached SCSI disk

Nothing wrong with the old kernel. The same message I have for the correct disk with NTFS partition:

Code:

root@pc:/# dmesg | grep sda
[    1.632383] sd 2:0:1:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    1.632572] sd 2:0:1:0: [sda] Write Protect is off
[    1.632642] sd 2:0:1:0: [sda] Mode Sense: 00 3a 00 00
[    1.632682] sd 2:0:1:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.650818]  sda: sda2 < sda5 >
[    1.651615] sd 2:0:1:0: [sda] Attached SCSI disk


usr345 12-19-2012 04:07 PM

Folks, all of a sudden it started to work. I have only 1 clue: some hardware problems. But why did it work on windows and older kernel?


All times are GMT -5. The time now is 04:30 PM.