Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add support for ioctl #3

Open
pavel-odintsov opened this issue Jul 15, 2014 · 1 comment
Open

Please add support for ioctl #3

pavel-odintsov opened this issue Jul 15, 2014 · 1 comment

Comments

@pavel-odintsov
Copy link

Hello!

I'm interested in mounting specific block device with partitions but I can't do it now because ioctl calls is not supported:

modprobe nbd max_part=16
partx -a /dev/nbd0 
HDIO_GETGEO: Inappropriate ioctl for device

You can find strace here:

strace -s 1024 -f partx -a /dev/nbd0 
execve("/sbin/partx", ["partx", "-a", "/dev/nbd0"], [/* 22 vars */]) = 0
brk(0)                                  = 0x1ab0000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8a2ed83000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=50992, ...}) = 0
mmap(NULL, 50992, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8a2ed76000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\355\1\0\0\0\0\0@\0\0\0\0\0\0\0\30,\35\0\0\0\0\0\0\0\0\0@\0008\0\n\0@\0J\0I\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0000\2\0\0\0\0\0\0000\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0\300\235\25\0\0\0\0\0\300\235\25\0\0\0\0\0\300\235\25\0\0\0\0\0\34\0\0\0\0\0\0\0\34\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\224\30\0\0\0\0\0\360\224\30\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\0\227\30\0\0\0\0\0\0\2278\0\0\0\0\0\0\2278\0\0\0\0\0\230F\0\0\0\0\0\0\250\221\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0@\313\30\0\0\0\0\0@\3138\0\0\0\0\0@\3138\0\0\0\0\0\360\1\0\0\0\0\0\0\360\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0p\2\0\0\0\0\0\0p\2\0\0\0\0\0\0p\2\0\0\0\0\0\0D\0\0\0\0\0\0\0D\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\7\0\0\0\4\0\0\0\0\227\30\0\0\0\0\0\0\2278\0\0\0\0\0\0\2278\0\0\0\0\0\20\0\0\0\0\0\0\0h\0\0\0\0\0\0\0\10\0\0\0\0\0\0\0P\345td\4\0\0\0\334\235\25\0\0\0\0\0\334\235\25\0\0\0\0\0\334\235\25\0\0\0\0\0\374e\0\0\0\0\0\0\374e\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\0\0\0\0R\345td\4\0\0\0\0\227\30\0\0\0\0\0\0\2278\0\0\0\0\0\0\2278\0\0\0\0\0\0009\0\0\0\0\0\0\0009\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\35m{:\f\361W\23\20\372\266\342\225\10\355\336\341\24i\245\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0\22\0\0\0\0\0\0\0\363\3\0\0\t\0\0\0\0\1\0\0\16\0\0\0\0000\20D\240 \2\1\210\3\346\220\305E\214\0\300\0\10\0\5\200\0`\300\200\0\r\212\f\0\4\20\0\210D2\10.@\210P4, \16\"H&\204\300\214\4\10\0\2\2\16\241\254\32\4f\300\0\3002\0\300\0P\1 \201\10\204\v  ($\0\4 P\0\20X\200\312DB(\0\6\200\20\30B\0 @\200\0\tP\0Q\212@\20\0\0\0\0\10\0\0\21\20", 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1916568, ...}) = 0
mmap(NULL, 3745960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f8a2e7d2000
mprotect(0x7f8a2e95c000, 2093056, PROT_NONE) = 0
mmap(0x7f8a2eb5b000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x189000) = 0x7f8a2eb5b000
mmap(0x7f8a2eb60000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f8a2eb60000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8a2ed75000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8a2ed74000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8a2ed73000
arch_prctl(ARCH_SET_FS, 0x7f8a2ed74700) = 0
mprotect(0x7f8a2eb5b000, 16384, PROT_READ) = 0
mprotect(0x7f8a2ed84000, 4096, PROT_READ) = 0
munmap(0x7f8a2ed76000, 50992)           = 0
brk(0)                                  = 0x1ab0000
brk(0x1ad1000)                          = 0x1ad1000
open("/dev/nbd0", O_RDONLY)             = 3
ioctl(3, 0x301, 0x7fff58d147d0)         = -1 ENOTTY (Inappropriate ioctl for device)
dup(2)                                  = 4
fcntl(4, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(4, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8a2ed82000
lseek(4, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(4, "HDIO_GETGEO: Inappropriate ioctl for device\n", 44HDIO_GETGEO: Inappropriate ioctl for device
) = 44
close(4)                                = 0
munmap(0x7f8a2ed82000, 4096)            = 0
exit_group(1)                           = ?

Please fix it...

@acozzette
Copy link
Owner

Thanks for the bug report--unfortunately I'm not actively working on this project anymore, so I am afraid I am not going to be able to fix this one. Feel free to send me a pull request, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants