ioctl error when opening database on external hard drive #10787

Open
szdavid92 opened this Issue Jul 10, 2017 · 6 comments

Comments

Projects
None yet
5 participants

Describe the issue

IO error when opening block database on NTFS partition of external hard drive on macOS.

Can you reliably reproduce the issue?

Yes.

If so, please list the steps to reproduce below:

  1. Delete database:
david@mac:/Volumes/SAMSUNG/Ledgers% rm -rf BitCoinCore

Open BitCoin-Qt. On Welcome Screen choose Use a custom data directory: /Volumes/SAMSUNG/Ledgers/BitCoinCore and click OK.
3.
Wild alert box appears:
image
Click OK.

Expected behaviour

Should start creating the block database I guess. Never made it through this step.

Actual behaviour

image
:(

Contents of debug.log:

2017-07-10 21:05:54 Bitcoin version v0.14.2
2017-07-10 21:05:54 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2017-07-10 21:05:54 Assuming ancestors of block 00000000000000000013176bf8d7dfeab4e1db31dc93bc311b436e82ab226b90 have valid signatures.
2017-07-10 21:05:54 Default data directory /Users/david/Library/Application Support/Bitcoin
2017-07-10 21:05:54 Using data directory /Volumes/SAMSUNG/Ledgers/BitCoinCore
2017-07-10 21:05:54 Using config file /Volumes/SAMSUNG/Ledgers/BitCoinCore/bitcoin.conf
2017-07-10 21:05:54 Using at most 125 automatic connections (2560 file descriptors available)
2017-07-10 21:05:54 Using 32 MiB out of 32 requested for signature cache, able to store 1048576 elements
2017-07-10 21:05:54 Using 2 threads for script verification
2017-07-10 21:05:54 scheduler thread start
2017-07-10 21:05:54 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2017-07-10 21:05:54 Using wallet wallet.dat
2017-07-10 21:05:54 init message: Verifying wallet...
2017-07-10 21:05:54 CDBEnv::Open: LogDir=/Volumes/SAMSUNG/Ledgers/BitCoinCore/database ErrorFile=/Volumes/SAMSUNG/Ledgers/BitCoinCore/db.log
2017-07-10 21:05:54 Bound to [::]:8333
2017-07-10 21:05:54 Bound to 0.0.0.0:8333
2017-07-10 21:05:54 Cache configuration:
2017-07-10 21:05:54 * Using 2.0MiB for block index database
2017-07-10 21:05:54 * Using 8.0MiB for chain state database
2017-07-10 21:05:54 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2017-07-10 21:05:54 init message: Loading block index...
2017-07-10 21:05:54 Opening LevelDB in /Volumes/SAMSUNG/Ledgers/BitCoinCore/blocks/index
2017-07-10 21:05:54 IO error: /Volumes/SAMSUNG/Ledgers/BitCoinCore/blocks/index/000001.dbtmp: Inappropriate ioctl for device
2017-07-10 21:07:06 init message: Loading block index...
2017-07-10 21:07:06 Wiping LevelDB in /Volumes/SAMSUNG/Ledgers/BitCoinCore/blocks/index
2017-07-10 21:07:06 Opening LevelDB in /Volumes/SAMSUNG/Ledgers/BitCoinCore/blocks/index
2017-07-10 21:07:06 IO error: /Volumes/SAMSUNG/Ledgers/BitCoinCore/blocks/index/000001.dbtmp: Inappropriate ioctl for device

What version of bitcoin-core are you using?

Official binary, v0.14.2

Machine specs:

  • OS: macOS Sierra
  • CPU: -
  • RAM: -
  • Disk size: -
  • Disk Type (HD/SDD): HDD

Any extra information that might be useful in the debugging process.

I am using Paragon NTFS for Mac driver to enable writing to the drive. Didn't encounter any problems with other software so far.

Member

jonasschnelli commented Jul 11, 2017

It seems that NTFS causes troubles (leveldb internal):
#6606
#6528

Ideally you try to store the leveldb database on an internal disk (~3GB). You can symlink out the block-files (the large part).

Whats the reason to use NTFS on a Mac (third party drivers smell after causing troubles)?

Just had this issue.

Installed, downloaded blockchain then closed. Opened the client back up, encrypted my wallet. It crashed then wouldn't load aything from network drive with the same error.

If your network path is:
\someplace\bitcoin

And install dir is:
C:\Program Files\Bitcoin

Then client tries to lock a non existant file. Line from the log:

2017-07-11 07:59:34 IO error: C:\Program Files\Bitcoin\someplace\bitcoin\blocks\index\LOCK: Could not lock file.
2017-07-11 07:59:37 scheduler thread interrupt
2017-07-11 07:59:37 Shutdown: In progress...
2017-07-11 07:59:37 Shutdown: done

I created a symlink from the default data path:
C:\Users\MyUser\AppData\Roaming\Bitcoin

To the network drive, then added the datadir param to a shortcut of the bitcoin exe:
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir="C:\Users\MyUser\AppData\Roaming\Bitcoin"

It still wants to do a full re-sync of the blockchain, but it opens now.

Member

jonasschnelli commented Jul 11, 2017

@Andy-Baker:
That is a different one 2017-07-11 07:59:34 IO error: C:\Program Files\Bitcoin\someplace\bitcoin\blocks\index\LOCK: Could not lock file.

szdavid92 commented Jul 11, 2017 edited

@jonasschnelli The HDD was used with a Windows machine earlier, and didn't take the time to convert to HFS yet. I think I'll do so.

Owner

laanwj commented Jul 13, 2017

Yes, this is an upstream issue with leveldb.
Symlinking the block files indeed works.

For partitioning bitcoin $datadir files amongst internal/external drives, I recently created a candidate doc: https://github.com/jimhashhq/bitcoin/blob/3c0377db483c50c5a9aecfc4684d6329951a1c7c/doc/file-partition.md
This outlines which $datadir folders need to be on the internal drive and how to set up the "blocks" folder on an external drive. It seemed apropos this topic so I wanted to mention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment