by shigemk2

当面は技術的なことしか書かない

alua attach failed(-22)

ThinkPad X260にFedora24をインストールしようとすると、のっけから怒られた。

[3.756574] scsi 6:0:0:0: alua: Attach failed (-22)
[3.760403] sd 6:0:0:0: [sdb] No Caching mode page found
[3.760527] sd 6:0:0:0: [sdb] Assuming drive cache: write through

Fedora22から起きていて、しかもThinkPadで起きる問題らしいけど、Ubuntu16だと問題が起きないので、GNOMEの問題??Fedoraの問題??となってもやってる。

forums.fedoraforum.org

unix.stackexchange.com

Windows10に割り当てられているパーティションの縮小

環境

  • Lenovo ThinkPad X260
  • Windows10

概要

Windowsは全然明るくないので、ぜんぶ「ぽい」の話です。違ってたらなんかコメントをください。

設定→パーティションで検索するとパーティションの割り当てを縮小したり拡大したりできますが、限界があるみたいっす。

「ハードディスクパーティションの作成とフォーマット」とかでできるっぽい。

たとえばマシン自体のディスク容量が512GBだと256GBが縮小できるパーティションの限界っぽい。

これを限界突破するためには、なにがしかのツールを使うしかないっぽい。

で、使うのはAOMEIかEASEUS。

freesoft-100.com

www.pc-master.jp

EASEUSを最初使っていたけど、unknown errorが出たので、AOMEIを使うとWindowsに割り当てるパーティションの容量を40GBくらいまでに削ることができました。

www.todo-backup.com

td command-lineからPrestoのクエリを実行するの

Tオプションだ!

  -T, --type TYPE                  set query type (hive, pig, presto)

つまり例としては、こう。

$ td query -d example_db -T presto -w -r rset1 "select count(*) from table1"

見つけ方なんだけど、ドキュメントを読んでもよくわからなかったので、ヘルプ。

td query --help
usage:
  $ td query [sql]

example:
  $ td query -d example_db -w -r rset1 "select count(*) from table1"
  $ td query -d example_db -w -r rset1 -q query.txt

description:
  Issue a query

options:
  -d, --database DB_NAME           use the database (required)
  -w, --wait                       wait for finishing the job
  -G, --vertical                   use vertical table to show results
  -o, --output PATH                write result to the file
  -f, --format FORMAT              format of the result to write to the file (tsv, csv, json, msgpack, and msgpack.gz)
  -r, --result RESULT_URL          write result to the URL (see also result:create subcommand)
                                    It is suggested for this option to be used with the -x / --exclude option to suppress printing
                                    of the query result to stdout or -o / --output to dump the query result into a file.
  -u, --user NAME                  set user name for the result URL
  -p, --password                   ask password for the result URL
  -P, --priority PRIORITY          set priority
  -R, --retry COUNT                automatic retrying count
  -q, --query PATH                 use file instead of inline query
  -T, --type TYPE                  set query type (hive, pig, presto)
      --sampling DENOMINATOR       OBSOLETE - enable random sampling to reduce records 1/DENOMINATOR
  -l, --limit ROWS                 limit the number of result rows shown when not outputting to file
  -c, --column-header              output of the columns' header when the schema is available for the table (only applies to json, tsv and csv formats)
  -x, --exclude                    do not automatically retrieve the job result
  -O, --pool-name NAME             specify resource pool by name
      --domain-key DOMAIN_KEY      optional user-provided unique ID. You can include this ID with your `create` request to ensure idempotence

docker runでオプションの順番を間違えるとダメだよってメモ

ダメなパターン

docker run -it -d --name fluentd -p 24224:24224 imageId -v /tmp:/fluentd/log /bin/bash

なんでこれがだめかっていうと、docker runは以下のように書かないといけないから。

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

imageのあとにオプションつけたらそりゃおこられるよね、っていう話。だから、上の例でいうと、-vオプションなんてありませんっていう怒られ方をする。