/srv/irclogs.ubuntu.com/2010/12/29/#ubuntu-kernel.txt

=== Guest180 is now known as ogra
lagbug 69527407:35
ubot2Launchpad bug 695274 in linux (Ubuntu) "WARNING: at /build/buildd/linux-2.6.35/net/sched/sch_generic.c:258 dev_watchdog+0x1fd/0x210() (affects: 1) (heat: 6)" [Undecided,New] https://launchpad.net/bugs/69527407:35
trapickiI've a problem with partition sizes and kernel reported disk size. Partitions seem to extend beyond the end of the disk.12:07
trapickiKernel is 2.6.35-24-generic. Seems like Linux calculates the disk size too small. The partition is NTFS and works fine on Windows XP and Windows 7.12:09
trapickiAnyone an idea about the disk size/capacity problem? I read the Large Disk HOWTO (a little old, anyway), and there seem to have been issues with disk capacity and reported C/H/S . My disk is attached via USB, no idea how capacity is calculated for USB mass storage.14:49
czrtrapicki, capacity is "calculated" by the device reporting it in LBA sectors.14:51
czrtrapicki, how large is the device?14:51
trapickiHello czr! The drive is 2TB, more like 1.83 TiB.14:52
czrwhat does blockdev --getsize /dev/sdX report?14:52
trapicki# blockdev --getsize /dev/sdh14:52
trapicki390702489614:52
czrright. that's just shy above 2TB14:53
czrwhich shouldn't cause a problem at all.14:53
czrcan you use pastebin and put the contents of fdisk -l -u /dev/sdh there?14:54
czralso, prepend to that the contents of : grep sdh /proc/partitions14:54
* czr runs for a smoke meanwhile, brb14:55
czrtrapicki, you still here?14:58
trapickiczr: see http://pastebin.com/ww7QARuk14:59
czrhmm. that is severely broken15:00
trapickiI found quite some reports of that problem with disks not ending at a cylinder. See http://ubuntuforums.org/archive/index.php/t-1603349.html Comment srs569415:01
trapickiOctober 28th, 2010, 11:39 PM15:01
trapickiIs there any way to find out where the calculation went wrong?15:02
czryes. the partition table looks really suspect15:02
czrwhat did you use to create it?15:02
czrgood news is that the kernel detects the disk size correctly, so it's not a driver problem15:03
trapickiThe drive was shipped with this partition by WD. Works fine on WinXP and Win7.15:03
czrhowever, when it starts parsing the partitions, it will get into trouble very quickly, resulting in incorrect /proc/partitions, and hence, completely incorrect view of the disk15:03
trapickiOf course, a partition stretching beyond the end of the disk is not sane.15:04
czrlet me dig around a bit15:04
trapickiI checked the partition table, is MBR, no GPT.15:04
czrtrapicki, right. pastebin the following: 1) sudo parted, 2) unit s 3) print15:08
czrparted is interactive, so enter 2 and 3 as commands15:08
czrI remembered there was a tool just to dump the "semiraw" contents of partition table, but rememberd that I had to write the tool myself some years back (can't find it now)..15:09
trapicki# parted /dev/sdh15:10
trapickiGNU Parted 2.315:10
trapickiUsing /dev/sdh15:10
trapickiWelcome to GNU Parted! Type 'help' to view a list of commands.15:10
trapicki(parted) unit s                                                           15:10
trapicki(parted) print                                                            15:10
trapickiError: Can't have a partition outside the disk!                           15:10
trapicki(parted)           15:10
trapickiSorry.15:10
czrheh. ok then.15:12
trapickiczr, you said the kernel detected the size correctly. But when the partitions are scanned, the partition size is truncated:15:12
czrseems that the WD comes with broken partition table15:12
czryes. I said the kernel detected the disk size correctly.15:12
trapicki[    4.373991] sd 6:0:0:0: [sdh] Assuming drive cache: write through15:12
trapicki[    4.373996]  sdh: sdh115:12
trapicki[    4.389915] sdh: p1 size 3907027120 extends beyond EOD, enabling native capac15:12
czrno need to paste here15:12
czrI read your pastebin from earlier15:12
czrhttp://community.wdc.com/t5/Other-Externals/2TB-WD-Elements-HD-can-t-reformat/td-p/3753515:12
czrseems like a common issue15:12
czrthe fact that it happens to work in windows is not really of interest. the fact that people have to remove the volume and recreate it in order to make a filesystem (in windows) does signal that it's not really an issue in how linux works.15:13
czrso. linux does the right thing, even if it's not the same thing as your windows.15:14
trapickiI really do not want to repartition the drive. Lots of stuff on it, and as it's one of the biggest currently available, its not that easy to backup. Given the table is right and the capacity is reported wron15:15
czrthe table is not right.15:15
trapicki is there any way to find out which steps are taken to calculate the drive capacity?15:16
czrnow, if you're really desperate, you could make a dm mapping (for example with kpartx tools) and manually set the start and ending sectors for the dm volume slice.15:16
czrwhich you could then attempt to mount15:16
czrtrapicki, here are the steps: http://lxr.linux.no/linux+v2.6.36/fs/partitions/msdos.c#L43215:18
trapickiI guess the drive size is queried via usb mass storage directly from the drive, right?15:19
trapickiThanks for the hint btw.15:19
czryes15:21
czrthe drive size is detected correctly15:21
czrbut let me think a bit. you're using 32-bit host, right?15:21
trapickino, 64bit. Linux corvusmons 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 GNU/Linux15:22
czrhmm. yes. the partition doesn't actually run off that much off the disk15:24
czrfdisk has internal issues when doing the -l, which is why the values are whacked there15:24
czrso, the fact that the kernel will clip the partition sizes to end at the disk end would mean that some ntfs structures at the end of the disk wouldn't be accessible15:25
czrand there's really no good way around that if you plan to use the ntfs in anyway15:25
czreven the kpartx trick won't work15:25
czrso, I'm out of help here. the issue isn't in linux. the issue is with the incorrect partition table contents, and probably also ntfs boot device descriptor. windows works around it (but will probably eventually stop working), linux refuses to work around it, since it's just wrong.15:26
trapickintfs would not mount, it accesses the end of the disk soon, and boils out with errors about anavailable sectors. I would ignore the missing sectors, ntfs isn't :-(15:26
czrdump the data somewhere in windows, then recreate the partition and then you're done.15:26
trapicki:-(, but ok, seems the way to go.15:27
czryes. you could try using ntfsfix to fix the filesystem itself, but it's very likely that you'll just break it even more. so don't do it.15:27
czrWD is evil.15:27
czrfor selling such crap.15:27
trapickiMaybe some windows partition tool will resize the fs and the partition.15:28
trapickiyes, really crappy.15:28
trapickiThanks for your help.15:30
trapickiFinally traced the USB traffic, and it reported 3907024895 LBA with 512 bytes/block. So the partition table is definitely wrong.16:18
=== yofel_ is now known as yofel
=== doko__ is now known as doko
=== _LibertyZero is now known as LibertyZero
=== Quintasan_ is now known as Quintasan
apwxclaesse, that bug already affects the current development release which is natty23:37

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!