[MDEV-4745] Cannot access data on NTFS drive. Created: 2013-07-01 Updated: 2013-07-26 Due: 2013-08-05 Resolved: 2013-07-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.31 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Michael Davies | Assignee: | Axel Schwenke |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux Mint 15. SSD boot drive ext4 with ide data drive NTFS. Intel Dual Core 2.7Mhz. 4Gb Ram. |
||
| Attachments: |
|
| Description |
|
Can only access data on the boot drive. My thoughts could be linked to permissions as mounted drives are owned by ROOT account no MySql account. Possibly MariaDb is starting before the drive is mounted after a reboot. Reproduce as detailed below: |
| Comments |
| Comment by Elena Stepanova [ 2013-07-01 ] |
|
Hi, Why won't you try to skip step 11 in your description and see if just restarting server solves the problem? If the reason is in the order of MariaDB start / drive mounting on reboot, by step 10 the drives should surely be mounted, so the server restart should help. If not, then it's not the reason... |
| Comment by Michael Davies [ 2013-07-02 ] |
|
Hi Elena |
| Comment by Elena Stepanova [ 2013-07-05 ] |
|
Hi Michael, Have you figured out the reason of your problem? It's not quite clear from your last comment whether you found that the system was misconfigured, or still suspect there is a bug on the server side. Your initial description also doesn't seem complete. At the very least, you should have updated your server config file some time beween 1 and 3, did you? If you still think there is a bug, please provide your cnf file(s) that the server users, SHOW GLOBAL VARIABLES output, and the full contents of the server error log from server start and up and including the InnoDB error. Thanks. |
| Comment by Michael Davies [ 2013-07-06 ] |
|
Hi Elena, |
| Comment by Elena Stepanova [ 2013-07-07 ] |
|
Hi Michael, Thanks. How exactly did you do the copying? Did you copy the entire private folder, or did you create a new one and copied the contents of the old one into the new one, and if so, did you copy all contents or only schema folders? ls -l /mnt/25Media/mariadb/mysql/private/ so that we could see that the InnoDB data files are there indeed? Is the path to the mounted datadir a real path, or does it contain any links? Aren't there any disk errors by any chance? Regarding the "bad" log that you provided – is it the very first attempt to start server on the mounted datadir? >> could it be related to the use of an SSD drive? |
| Comment by Michael Davies [ 2013-07-07 ] |
|
Hi Elena, |
| Comment by Michael Davies [ 2013-07-07 ] |
|
I have done further tests as follows: |
| Comment by Elena Stepanova [ 2013-07-07 ] |
|
Hi, >> It points to an incompatibility between ssd and sata drives It's a contradiction with your previous comment, if I understand it correctly... You said: >> deleting all contents of the folder, creating schemas using workbench and running scripts to create all the databases and data; using scripts created with "sudo mysqldump". Both methods produced the same errors. When you do it this way, there are no files moved from ssd to sata at all, you create all data files from scratch on the sata drive simply by executing plain SQL on your brand-new empty database. If you are still getting the same error on newly created data like that, it might be a game changer. So, you had a server running on /var/lib/mysql/private and created a data dump using sudo mysqldump --all-databases. I've installed Linux Mint 15 in a VM, created an NTFS primary partition and installed workbench, so I'll try to reproduce the whole scenario with mysqldump once I know how exactly you did it (I had no luck with moving data files around, but then again, there was a possibility that it's ssd-related, the mysqldump scenario should rule it out). Thanks. |
| Comment by Michael Davies [ 2013-07-08 ] |
|
Hi, |
| Comment by Axel Schwenke [ 2013-07-23 ] |
|
Hi Michael, Elena asked me to have a look at this issue. To me it boils down to this: if you copy the MariaDB datadir to a NTFS partition then MariaDB works ok with the copy. However after rebooting your server, certain data is missing in the NTFS partition. Resulting in MariaDD refusing to start or giving errors on access. The common point seems to be the NTFS file system you are using. May I ask why you chose NTFS? Do you have to access the same partition from Windows? My theory of what happens, is this: the Linux kernel keeps modified disk blocks in memory and writes them back later when the disk is idle. Normally when you reboot Linux, it flushes all file systems first. It's quite possible that this is broken for NTFS. Or maybe your way to "reboot the server" makes it skip that point. Can you elaborate on how exactly you do that reboot? In order to check my theory I ask you to do this: 1. create a fresh copy of the datadir on your NTFS partition Thanks |
| Comment by Michael Davies [ 2013-07-24 ] |
|
Hi Axel, 1. Followed your instructions to the letter using a sata ntfs drive.. I hope this is helpful to you. Regards |
| Comment by Axel Schwenke [ 2013-07-24 ] |
|
Hi Michael, three points: 1. did you manually unmount the NTFS partition before rebooting? How is it mounted, btw? Is it in fstab or is this some automatic mount mechanism? 2. the errors for the USB stick are related to file permissions. When you copy the files, make sure you also copy ownership and permissions. As for any removable media, you should use some form of "safe remove" before unplugging the device. I never used MINT, but I guess it has some means for that. Else simply unmount manually. 3. in all cases it seems that MariaDB was not stopped before rebooting, because InnoDB claimed an unclean shutdown. Please make sure that the MariaDB is stopped first. The correct order of actions is: stop MariaDB server, unmount filesystem, reboot Thanks. |
| Comment by Michael Davies [ 2013-07-25 ] |
|
Hi Axel, As an aside, have you considered the different geometry between ssd Thanks |
| Comment by Axel Schwenke [ 2013-07-25 ] |
|
taking over |
| Comment by Axel Schwenke [ 2013-07-25 ] |
|
Axel session log |
| Comment by Axel Schwenke [ 2013-07-26 ] |
|
Hi Michael, I have now tried a very similar test as yours. I have formatted a 16GB USB stick with NTFS, created a MariaDB instance on it, rebooted and started MariaDB again. All data from former MariaDB run was ok and new data could be added. Please see attached file axel.log for details (I used 3 screen sessions to record this) Re your other questions: > have you considered the different geometry between ssd Drive geometries are obsolete for decades. Rotating disks use http://en.wikipedia.org/wiki/Zone_bit_recording and displayed disk geometries are bogus (because number of sectors is not constant over cylinders). Further more, addressing of disk sectors is not longer using http://en.wikipedia.org/wiki/Cylinder-head-sector addresses, but http://en.wikipedia.org/wiki/Logical_block_addressing. This change was also necessary to overcome limitation of disk size (CHS was limited to 1024 cylinders, 16 heads, 63 sectors, totaling to 504MB). On top of that: MariaDB is storing data in files. Anything from block device addressing over device block size up to the file system used is completely invisible to MariaDB. > I have had correspondence with the This is a pinch of truth in an ocean of nonsense. Indeed SSD don't have sectors in the conventional meaning. But then also rotating disks lie about their geometry and happily convert fake CHS addresses or LBA addresses to their hidden physical geometry. Recent hard disk even use 4KB sectors internally but mimic old fashioned 512 byte sectors on their interface. The truth is that mass storage addressing and volume sizes in Linux use logical addresses for ages now. And the size of a volume is simply a multiple of the device block (sector) size. If you don't believe me: look at the partition table of a device once with "fdisk -l <device>" - this shows CHS coordinates. And with "fdisk -lu <device>" - this shows LBA block numbers. If you run fdisk with the -u option, you can start a partition on any sector you want, even in the mid of a cylinder. It simply doesn't matter. Finally: the machine I'm typing on now and which I ran my tests on, is my laptop - running an SSD. It was delivered with a hard disk though and I simply used ntfsclone (from the ntfs-3g toolkit) to copy the pre-installed Windows image to the SSD. I could have used dd or even cat as well, but I didn't want to copy the unused blocks. So as far as cloning of partitions goes, there is no difference between a rotating hard disk and a SSD whatsoever. The only constraint is that the target partition must be at least as big as the source partition. |
| Comment by Michael Davies [ 2013-07-26 ] |
|
Thanks Axel, Regarding ssd drives. I do not pretend to be an expert and mainly quoted Thanks Again |
| Comment by Axel Schwenke [ 2013-07-26 ] |
|
Hi Michael, > Perhaps we can put this problem down to my particular system. I will use OK, I will close this ticket then. BR, Axel |