■参考URL

https://goodbyegangster.hatenablog.com/entry/2020/06/17/055527

https://garafu.blogspot.com/2018/02/mongodb-3instance-replicaset.html

 

■構成

     ホスト名       IPアドレス  

VM1  pc3_centos7_k2  192.168.101.32 

VM2  pc3_centos7_k3  192.168.101.33

 

※VM1とVM2はいずれも下記の通り

OS             CentOS7.3

メモリ            2GB

CPU             2core

MongoDBバージョン  version v4.4.1

 

■レプリカセット作成前の状態確認

[pc3_centos7_k2]$ mongo

----(略)----

> rs.status()
{
        "ok" : 0,
        "errmsg" : "not running with --replSet",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
}

> rs.conf()
uncaught exception: Error: Could not retrieve replica set config: {
        "ok" : 0,
        "errmsg" : "not running with --replSet",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
} :
rs.conf@src/mongo/shell/utils.js:1595:11
@(shell):1:1

> rs.initiate()
{
        "ok" : 0,
        "errmsg" : "This node was not started with the replSet option",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
}

> rs.status()
{
        "ok" : 0,
        "errmsg" : "not running with --replSet",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
}

> rs.conf()
uncaught exception: Error: Could not retrieve replica set config: {
        "ok" : 0,
        "errmsg" : "not running with --replSet",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
} :
rs.conf@src/mongo/shell/utils.js:1595:11
@(shell):1:1

> exit
bye

 

■検証準備

[pc3_centos7_k2]$ setenforce 0
[pc3_centos7_k2]$ iptables -F
[pc3_centos7_k2]$ cp -p /etc/mongod.conf{,.org}

 

[pc3_centos7_k3]$ setenforce 0
[pc3_centos7_k3]$ iptables -F

[pc3_centos7_k3]$ cp -p /etc/mongod.conf{,.org}

 

■Replica Setの作成

[pc3_centos7_k2]$ vi /etc/mongod.conf

----(略)----

[pc3_centos7_k2]$ diff /etc/mongod.conf{.org,}
29c29,30
<   bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
---
>  # bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
>   bindIp: 0.0.0.0  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
36a38,41
> replication:
>     oplogSizeMB: 30
>     replSetName: "replicaset0"
>     enableMajorityReadConcern: false

[pc3_centos7_k2]$ scp mongod.conf 192.168.101.33:/etc/

----(略)----

 

■Replica Setの初期化

・まだmongodサービスを再起動してない。

[pc3_centos7_k2]$ mongo

----(略)----

> rs.status()
{
        "ok" : 0,
        "errmsg" : "not running with --replSet",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
}

> rs.config()
uncaught exception: Error: Could not retrieve replica set config: {
        "ok" : 0,
        "errmsg" : "not running with --replSet",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
} :
rs.conf@src/mongo/shell/utils.js:1595:11
@(shell):1:1

→当然まだ何も変わってない。

> rs.initiate( {
... _id: "replicaset0",
... members: [
...   { _id: 0, host: "192.168.101.32:27017" },
...   { _id: 1, host: "192.168.101.33:27017" }
... ]
... })

{
        "ok" : 0,
        "errmsg" : "This node was not started with the replSet option",
        "code" : 76,
        "codeName" : "NoReplicationEnabled"
}

→mongodサービスを再起動しないと初期化はできない。

> exit
bye

・mongodサービスを再起動

[pc3_centos7_k2]$ systemctl restart mongod

[pc3_centos7_k2]$ echo $?
0

[pc3_centos7_k3]$ systemctl restart mongod
[pc3_centos7_k3]$ echo $?

0

[pc3_centos7_k2]$ mongo

----(略)----

> rs.status()
{
        "operationTime" : Timestamp(0, 0),
        "ok" : 0,
        "errmsg" : "no replset config has been received",
        "code" : 94,
        "codeName" : "NotYetInitialized",

        "$clusterTime" : {
                "clusterTime" : Timestamp(0, 0),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
}

> rs.config()
uncaught exception: Error: Could not retrieve replica set config: {
        "operationTime" : Timestamp(0, 0),
        "ok" : 0,
        "errmsg" : "no replset config has been received",
        "code" : 94,
        "codeName" : "NotYetInitialized",

        "$clusterTime" : {
                "clusterTime" : Timestamp(0, 0),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
} :
rs.conf@src/mongo/shell/utils.js:1595:11
@(shell):1:1

→エラー内容が「まだ初期化してない」に変わった。

・Replica Setの初期化

※初期化はプライマリ側(pc3_centos7_k2)でのみ行う。

 

> rs.initiate( {
... _id: "replicaset0",
... members: [
...   { _id: 0, host: "192.168.101.32:27017" },
...   { _id: 1, host: "192.168.101.33:27017" }
... ]
... })

{
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1602744480, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        },
        "operationTime" : Timestamp(1602744480, 1)
}

・確認

replicaset0:PRIMARY> rs.status()
{
        "set" : "replicaset0",
        "date" : ISODate("2020-10-15T06:54:58.001Z"),
        "myState" : 1,
        "term" : NumberLong(1),
        "syncSourceHost" : "",
        "syncSourceId" : -1,
        "heartbeatIntervalMillis" : NumberLong(2000),
        "majorityVoteCount" : 2,
        "writeMajorityCount" : 2,
        "votingMembersCount" : 2,
        "writableVotingMembersCount" : 2,
        "optimes" : {
                "lastCommittedOpTime" : {
                        "ts" : Timestamp(1602744892, 1),
                        "t" : NumberLong(1)
                },
                "lastCommittedWallTime" : ISODate("2020-10-15T06:54:52.132Z"),
                "readConcernMajorityOpTime" : {
                        "ts" : Timestamp(1602744892, 1),
                        "t" : NumberLong(1)
                },
                "readConcernMajorityWallTime" : ISODate("2020-10-15T06:54:52.132Z"),
                "appliedOpTime" : {
                        "ts" : Timestamp(1602744892, 1),
                        "t" : NumberLong(1)
                },
                "durableOpTime" : {
                        "ts" : Timestamp(1602744892, 1),
                        "t" : NumberLong(1)
                },
                "lastAppliedWallTime" : ISODate("2020-10-15T06:54:52.132Z"),
                "lastDurableWallTime" : ISODate("2020-10-15T06:54:52.132Z")
        },
        "electionCandidateMetrics" : {
                "lastElectionReason" : "electionTimeout",
                "lastElectionDate" : ISODate("2020-10-15T06:48:11.864Z"),
                "electionTerm" : NumberLong(1),
                "lastCommittedOpTimeAtElection" : {
                        "ts" : Timestamp(0, 0),
                        "t" : NumberLong(-1)
                },
                "lastSeenOpTimeAtElection" : {
                        "ts" : Timestamp(1602744480, 1),
                        "t" : NumberLong(-1)
                },
                "numVotesNeeded" : 2,
                "priorityAtElection" : 1,
                "electionTimeoutMillis" : NumberLong(10000),
                "numCatchUpOps" : NumberLong(0),
                "newTermStartDate" : ISODate("2020-10-15T06:48:12.012Z"),
                "wMajorityWriteAvailabilityDate" : ISODate("2020-10-15T06:48:13.203Z")
        },
        "members" : [
                {
                        "_id" : 0,
                        "name" : "192.168.101.32:27017",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 1839,
                        "optime" : {
                                "ts" : Timestamp(1602744892, 1),
                                "t" : NumberLong(1)
                        },
                        "optimeDate" : ISODate("2020-10-15T06:54:52Z"),
                        "syncSourceHost" : "",
                        "syncSourceId" : -1,
                        "infoMessage" : "",
                        "electionTime" : Timestamp(1602744491, 1),
                        "electionDate" : ISODate("2020-10-15T06:48:11Z"),
                        "configVersion" : 1,
                        "configTerm" : 1,
                        "self" : true,
                        "lastHeartbeatMessage" : ""
                },
                {
                        "_id" : 1,
                        "name" : "192.168.101.33:27017",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 417,
                        "optime" : {
                                "ts" : Timestamp(1602744892, 1),
                                "t" : NumberLong(1)
                        },
                        "optimeDurable" : {
                                "ts" : Timestamp(1602744892, 1),
                                "t" : NumberLong(1)
                        },
                        "optimeDate" : ISODate("2020-10-15T06:54:52Z"),
                        "optimeDurableDate" : ISODate("2020-10-15T06:54:52Z"),
                        "lastHeartbeat" : ISODate("2020-10-15T06:54:56.105Z"),
                        "lastHeartbeatRecv" : ISODate("2020-10-15T06:54:57.631Z"),
                        "pingMs" : NumberLong(0),
                        "lastHeartbeatMessage" : "",
                        "syncSourceHost" : "192.168.101.32:27017",
                        "syncSourceId" : 0,
                        "infoMessage" : "",
                        "configVersion" : 1,
                        "configTerm" : 1
                }
        ],
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1602744892, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        },
        "operationTime" : Timestamp(1602744892, 1)
}

replicaset0:PRIMARY> rs.config()
{
        "_id" : "replicaset0",
        "version" : 1,
        "term" : 1,
        "protocolVersion" : NumberLong(1),
        "writeConcernMajorityJournalDefault" : true,
        "members" : [
                {
                        "_id" : 0,
                        "host" : "192.168.101.32:27017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 1,
                        "tags" : {

                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                },
                {
                        "_id" : 1,
                        "host" : "192.168.101.33:27017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 1,
                        "tags" : {

                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                }
        ],
        "settings" : {
                "chainingAllowed" : true,
                "heartbeatIntervalMillis" : 2000,
                "heartbeatTimeoutSecs" : 10,
                "electionTimeoutMillis" : 10000,
                "catchUpTimeoutMillis" : -1,
                "catchUpTakeoverDelayMillis" : 30000,
                "getLastErrorModes" : {

                },
                "getLastErrorDefaults" : {
                        "w" : 1,
                        "wtimeout" : 0
                },
                "replicaSetId" : ObjectId("5f87f0a0f4ed6ead8f503a5d")
        }
}

・すかさずpc3_centos7_k3で確認。

[pc3_centos7_k3]$ mongo

----(略)----

replicaset0:SECONDARY> rs.status()
{
        "set" : "replicaset0",
        "date" : ISODate("2020-10-15T06:58:36.655Z"),
        "myState" : 2,
        "term" : NumberLong(1),
        "syncSourceHost" : "192.168.101.32:27017",
        "syncSourceId" : 0,
        "heartbeatIntervalMillis" : NumberLong(2000),
        "majorityVoteCount" : 2,
        "writeMajorityCount" : 2,
        "votingMembersCount" : 2,
        "writableVotingMembersCount" : 2,
        "optimes" : {
                "lastCommittedOpTime" : {
                        "ts" : Timestamp(1602745112, 1),
                        "t" : NumberLong(1)
                },
                "lastCommittedWallTime" : ISODate("2020-10-15T06:58:32.139Z"),
                "readConcernMajorityOpTime" : {
                        "ts" : Timestamp(1602745112, 1),
                        "t" : NumberLong(1)
                },
                "readConcernMajorityWallTime" : ISODate("2020-10-15T06:58:32.139Z"),
                "appliedOpTime" : {
                        "ts" : Timestamp(1602745112, 1),
                        "t" : NumberLong(1)
                },
                "durableOpTime" : {
                        "ts" : Timestamp(1602745112, 1),
                        "t" : NumberLong(1)
                },
                "lastAppliedWallTime" : ISODate("2020-10-15T06:58:32.139Z"),
                "lastDurableWallTime" : ISODate("2020-10-15T06:58:32.139Z")
        },
        "electionParticipantMetrics" : {
                "votedForCandidate" : true,
                "electionTerm" : NumberLong(1),
                "lastVoteDate" : ISODate("2020-10-15T06:48:11.877Z"),
                "electionCandidateMemberId" : 0,
                "voteReason" : "",
                "lastAppliedOpTimeAtElection" : {
                        "ts" : Timestamp(1602744480, 1),
                        "t" : NumberLong(-1)
                },
                "maxAppliedOpTimeInSet" : {
                        "ts" : Timestamp(1602744480, 1),
                        "t" : NumberLong(-1)
                },
                "priorityAtElection" : 1,
                "newTermStartDate" : ISODate("2020-10-15T06:48:12.012Z"),
                "newTermAppliedDate" : ISODate("2020-10-15T06:48:13.186Z")
        },
        "members" : [
                {
                        "_id" : 0,
                        "name" : "192.168.101.32:27017",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 635,
                        "optime" : {
                                "ts" : Timestamp(1602745112, 1),
                                "t" : NumberLong(1)
                        },
                        "optimeDurable" : {
                                "ts" : Timestamp(1602745112, 1),
                                "t" : NumberLong(1)
                        },
                        "optimeDate" : ISODate("2020-10-15T06:58:32Z"),
                        "optimeDurableDate" : ISODate("2020-10-15T06:58:32Z"),
                        "lastHeartbeat" : ISODate("2020-10-15T06:58:35.740Z"),
                        "lastHeartbeatRecv" : ISODate("2020-10-15T06:58:36.211Z"),
                        "pingMs" : NumberLong(0),
                        "lastHeartbeatMessage" : "",
                        "syncSourceHost" : "",
                        "syncSourceId" : -1,
                        "infoMessage" : "",
                        "electionTime" : Timestamp(1602744491, 1),
                        "electionDate" : ISODate("2020-10-15T06:48:11Z"),
                        "configVersion" : 1,
                        "configTerm" : 1
                },
                {
                        "_id" : 1,
                        "name" : "192.168.101.33:27017",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 1868,
                        "optime" : {
                                "ts" : Timestamp(1602745112, 1),
                                "t" : NumberLong(1)
                        },
                        "optimeDate" : ISODate("2020-10-15T06:58:32Z"),
                        "syncSourceHost" : "192.168.101.32:27017",
                        "syncSourceId" : 0,
                        "infoMessage" : "",
                        "configVersion" : 1,
                        "configTerm" : 1,
                        "self" : true,
                        "lastHeartbeatMessage" : ""
                }
        ],
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1602745112, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        },
        "operationTime" : Timestamp(1602745112, 1)
}

replicaset0:SECONDARY> rs.config()
{
        "_id" : "replicaset0",
        "version" : 1,
        "term" : 1,
        "protocolVersion" : NumberLong(1),
        "writeConcernMajorityJournalDefault" : true,
        "members" : [
                {
                        "_id" : 0,
                        "host" : "192.168.101.32:27017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 1,
                        "tags" : {

                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                },
                {
                        "_id" : 1,
                        "host" : "192.168.101.33:27017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 1,
                        "tags" : {

                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                }
        ],
        "settings" : {
                "chainingAllowed" : true,
                "heartbeatIntervalMillis" : 2000,
                "heartbeatTimeoutSecs" : 10,
                "electionTimeoutMillis" : 10000,
                "catchUpTimeoutMillis" : -1,
                "catchUpTakeoverDelayMillis" : 30000,
                "getLastErrorModes" : {

                },
                "getLastErrorDefaults" : {
                        "w" : 1,
                        "wtimeout" : 0
                },
                "replicaSetId" : ObjectId("5f87f0a0f4ed6ead8f503a5d")
        }
}

 

参照 「プロのためのLinuxシステム 10年効く技術 中井 悦司著 技術評論社 」P.30 

 

$ cat /tmp/shell1
#!/bin/bash
{ sleep 9;seq 1 100 > /tmp/1;echo 1; } &
{ sleep 8;seq 1 100 > /tmp/2;echo 2; } &
{ sleep 7;seq 1 100 > /tmp/3;echo 3; } &
echo shell end

$ /tmp/shell1
shell end
$ 3
2
1

 

$ cat /tmp/shell2
#!/bin/bash
{ sleep 9;seq 1 100 > /tmp/1;echo 1; } &
{ sleep 8;seq 1 100 > /tmp/2;echo 2; } &
{ sleep 7;seq 1 100 > /tmp/3;echo 3; }
echo shell end

$ /tmp/shell2

3
shell end

$ 2
1

 

$ cat /tmp/shell3
#!/bin/bash
{ sleep 9;seq 1 100 > /tmp/1;echo 1; } &
{ sleep 8;seq 1 100 > /tmp/2;echo 2; } &
{ sleep 7;seq 1 100 > /tmp/3;echo 3; } &
wait
echo shell end

$ /tmp/shell3
3
2
1
shell end

 

$ cat /tmp/shell4
#!/bin/bash
{ sleep 9;seq 1 100 > /tmp/1;echo 1; } &
{ sleep 8;seq 1 100 > /tmp/2;echo 2; } &
{ sleep 7;seq 1 100 > /tmp/3;echo 3; }
wait
echo shell end

$ /tmp/shell4

3
2
1
shell end

 

ちなみに、上記のいずれも、/tmp/1、/tmp/2、/tmp/3にはデータは書き込まれている。

 

$ type wait
wait はシェル組み込み関数です

 

※  wait [n ...]
      Wait for each specified process and return its termination status.  Each n may be a process ID or a job 

   specification; if a job spec is given, all processes in that job's pipeline are waited for.  If n is not given, 

   all currently active child processes are waited for, and the return status is zero.  If n specifies a non-

   existent process or job, the return status is 127.  Otherwise, the return status is the exit status of 

   the last process or job waited for.

 

 

 

 

ファイルシステムにデータを書き込み中に、ファイルシステムにxfs_freezeすると、ファイルシステムへの書き込みが中断状態になり、xfs_freeze -uで解除すると、中断状態から書き込みが続行される。

この動きをstraceで確認するぷに。

 

# strace -ttT -f -o /tmp/1.out dd if=/dev/zero of=/testlv/hoge bs=10M count=30
30+0 レコード入力
30+0 レコード出力
3172800 バイト (315 MB) コピーされました、 0.208926 秒、 1.5 GB/秒

→約0.2秒で書き込まれたぷに。

# strace -ttT -f -o /tmp/2.out dd if=/dev/zero of=/testlv/hoge bs=10M count=30 & { sleep 0.1;xfs_freeze -f /testlv; }
[1] 23637

別ターミナルから下記を実行。

# cp /tmp/2.out /tmp/2.out_freeze

# xfs_freeze -u /testlv

 

結果を見るンゴ

# cat /tmp/2.out

23640 01:11:07.194839 execve("/usr/bin/dd", ["dd", "if=/dev/zero", "of=/testlv/hoge", "bs=10M", "count=30"], 0x7fff020b9980 /* 25 vars */) = 0 <0.000260>
23640 01:11:07.195323 brk(NULL)         = 0x22a9000 <0.000009>
23640 01:11:07.195391 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb48f026000 <0.000010>
23640 01:11:07.195452 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (そのようなファイルやディレクトリはありません) <0.000012>
23640 01:11:07.195688 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 <0.000013>
23640 01:11:07.195747 fstat(3, {st_mode=S_IFREG|0644, st_size=20200, ...}) = 0 <0.000008>
23640 01:11:07.195804 mmap(NULL, 20200, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb48f021000 <0.000010>
23640 01:11:07.195844 close(3)          = 0 <0.000008>
23640 01:11:07.195888 open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 <0.000014>
23640 01:11:07.195933 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\34\2\0\0\0\0\0"..., 832) = 832 <0.000009>
23640 01:11:07.195979 fstat(3, {st_mode=S_IFREG|0755, st_size=2116736, ...}) = 0 <0.000008>
23640 01:11:07.196022 mmap(NULL, 3932672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb48ea47000 <0.000010>
23640 01:11:07.196061 mprotect(0x7fb48ebfd000, 2097152, PROT_NONE) = 0 <0.000012>
23640 01:11:07.196101 mmap(0x7fb48edfd000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b6000) = 0x7fb48edfd000 <0.000014>
23640 01:11:07.196149 mmap(0x7fb48ee03000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb48ee03000 <0.000011>
23640 01:11:07.196194 close(3)          = 0 <0.000008>
23640 01:11:07.196249 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb48f020000 <0.000009>
23640 01:11:07.196296 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb48f01e000 <0.000009>
23640 01:11:07.196341 arch_prctl(ARCH_SET_FS, 0x7fb48f01e740) = 0 <0.000008>
23640 01:11:07.196457 mprotect(0x7fb48edfd000, 16384, PROT_READ) = 0 <0.000012>
23640 01:11:07.196501 mprotect(0x610000, 4096, PROT_READ) = 0 <0.000010>
23640 01:11:07.196542 mprotect(0x7fb48f027000, 4096, PROT_READ) = 0 <0.000010>
23640 01:11:07.196580 munmap(0x7fb48f021000, 20200) = 0 <0.000015>
23640 01:11:07.196654 rt_sigaction(SIGUSR1, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 <0.000008>
23640 01:11:07.196699 rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 <0.000007>
23640 01:11:07.196737 rt_sigaction(SIGUSR1, {sa_handler=0x403cd0, sa_mask=[INT USR1], sa_flags=SA_RESTORER, sa_restorer=0x7fb48ea7c250}, NULL, 8) = 0 <0.000008>
23640 01:11:07.196776 rt_sigaction(SIGINT, {sa_handler=0x403cc0, sa_mask=[INT USR1], sa_flags=SA_RESTORER|SA_NODEFER|SA_RESETHAND, sa_restorer=0x7fb48ea7c250}, NULL, 8) = 0 <0.000007>
23640 01:11:07.196887 brk(NULL)         = 0x22a9000 <0.000007>
23640 01:11:07.196921 brk(0x22ca000)    = 0x22ca000 <0.000009>
23640 01:11:07.196957 brk(NULL)         = 0x22ca000 <0.000007>
23640 01:11:07.196998 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 <0.000013>
23640 01:11:07.197043 fstat(3, {st_mode=S_IFREG|0644, st_size=106070960, ...}) = 0 <0.000008>
23640 01:11:07.197085 mmap(NULL, 106070960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb48851e000 <0.000010>
23640 01:11:07.197127 close(3)          = 0 <0.000007>
23640 01:11:07.197213 open("/dev/zero", O_RDONLY) = 3 <0.000014>
23640 01:11:07.197270 dup2(3, 0)        = 0 <0.000008>
23640 01:11:07.197307 close(3)          = 0 <0.000007>
23640 01:11:07.197341 lseek(0, 0, SEEK_CUR) = 0 <0.000007>
23640 01:11:07.197375 open("/testlv/hoge", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 <0.068116>
23640 01:11:07.265554 dup2(3, 1)        = 1 <0.000008>
23640 01:11:07.265614 close(3)          = 0 <0.000005>
23640 01:11:07.265673 mmap(NULL, 10498048, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb487b1b000 <0.000031>
23640 01:11:07.265753 read(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"..., 10485760) = 10485760 <0.004147>
23640 01:11:07.269974 write(1, "\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"..., 10485760) = 10485760 <0.005652>
23640 01:11:07.275725 read(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"..., 10485760) = 10485760 <0.001211>
23640 01:11:07.277029 write(1, "\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"..., 10485760) = 10485760 <0.005426>
23640 01:11:07.282537 read(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"..., 10485760) = 10485760 <0.001186>
23640 01:11:07.283814 write(1, "\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"..., 10485760) = 10485760 <0.005372>
23640 01:11:07.289281 read(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"..., 10485760) = 10485760 <0.001200>
23640 01:11:07.290579 write(1, "\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"..., 10485760) = 10485760 <0.005329>
23640 01:11:07.295982 read(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"..., 10485760) = 10485760 <0.001292>
23640 01:11:07.297351 write(1, "\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"..., 10485760) = 10485760 <0.005196>
23640 01:11:07.302679 read(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"..., 10485760) = 10485760 <0.001254>
23640 01:11:07.304036 write(1, "\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"..., 10485760) = 10485760 <86.230434>
23640 01:12:33.534576 read(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"..., 10485760) = 10485760 <0.001420>
23640 01:12:33.536110 write(1, "\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"..., 10485760) = 10485760 <0.007061>
23640 01:12:33.543281 read(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"..., 10485760) = 10485760 <0.001361>
23640 01:12:33.544761 write(1, "\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"..., 10485760) = 10485760 <0.007030>
23640 01:12:33.551889 read(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"..., 10485760) = 10485760 <0.001313>
23640 01:12:33.553307 write(1, "\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"..., 10485760) = 10485760 <0.006765>
23640 01:12:33.560176 read(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"..., 10485760) = 10485760 <0.001312>
23640 01:12:33.561617 write(1, "\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"..., 10485760) = 10485760 <0.006453>
23640 01:12:33.568163 read(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"..., 10485760) = 10485760 <0.001288>
23640 01:12:33.569554 write(1, "\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"..., 10485760) = 10485760 <0.006332>
23640 01:12:33.575978 read(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"..., 10485760) = 10485760 <0.001266>
23640 01:12:33.577344 write(1, "\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"..., 10485760) = 10485760 <0.006189>
23640 01:12:33.583623 read(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"..., 10485760) = 10485760 <0.001234>
23640 01:12:33.584955 write(1, "\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"..., 10485760) = 10485760 <0.006048>
23640 01:12:33.591090 read(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"..., 10485760) = 10485760 <0.001242>
23640 01:12:33.592429 write(1, "\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"..., 10485760) = 10485760 <0.005828>
23640 01:12:33.598343 read(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"..., 10485760) = 10485760 <0.001229>
23640 01:12:33.599667 write(1, "\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"..., 10485760) = 10485760 <0.005739>
23640 01:12:33.605490 read(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"..., 10485760) = 10485760 <0.001206>
23640 01:12:33.606789 write(1, "\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"..., 10485760) = 10485760 <0.005648>
23640 01:12:33.612536 read(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"..., 10485760) = 10485760 <0.001190>
23640 01:12:33.613818 write(1, "\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"..., 10485760) = 10485760 <0.005527>
23640 01:12:33.619426 read(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"..., 10485760) = 10485760 <0.001191>
23640 01:12:33.620709 write(1, "\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"..., 10485760) = 10485760 <0.005371>
23640 01:12:33.626163 read(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"..., 10485760) = 10485760 <0.001183>
23640 01:12:33.627436 write(1, "\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"..., 10485760) = 10485760 <0.005323>
23640 01:12:33.632840 read(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"..., 10485760) = 10485760 <0.001166>
23640 01:12:33.634094 write(1, "\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"..., 10485760) = 10485760 <0.005273>
23640 01:12:33.639445 read(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"..., 10485760) = 10485760 <0.001167>
23640 01:12:33.640700 write(1, "\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"..., 10485760) = 10485760 <0.005141>
23640 01:12:33.645919 read(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"..., 10485760) = 10485760 <0.001158>
23640 01:12:33.647162 write(1, "\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"..., 10485760) = 10485760 <0.005121>
23640 01:12:33.652359 read(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"..., 10485760) = 10485760 <0.001150>
23640 01:12:33.653594 write(1, "\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"..., 10485760) = 10485760 <0.004988>
23640 01:12:33.658659 read(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"..., 10485760) = 10485760 <0.001154>
23640 01:12:33.659899 write(1, "\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"..., 10485760) = 10485760 <0.004945>
23640 01:12:33.664918 read(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"..., 10485760) = 10485760 <0.001143>
23640 01:12:33.666144 write(1, "\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"..., 10485760) = 10485760 <0.004914>
23640 01:12:33.671132 read(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"..., 10485760) = 10485760 <0.001146>
23640 01:12:33.672361 write(1, "\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"..., 10485760) = 10485760 <0.004735>
23640 01:12:33.677175 read(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"..., 10485760) = 10485760 <0.001154>
23640 01:12:33.678416 write(1, "\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"..., 10485760) = 10485760 <0.004614>
23640 01:12:33.683110 read(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"..., 10485760) = 10485760 <0.001141>
23640 01:12:33.684338 write(1, "\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"..., 10485760) = 10485760 <0.004562>
23640 01:12:33.688979 read(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"..., 10485760) = 10485760 <0.001137>
23640 01:12:33.690203 write(1, "\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"..., 10485760) = 10485760 <0.004452>
23640 01:12:33.694738 read(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"..., 10485760) = 10485760 <0.001123>
23640 01:12:33.695941 write(1, "\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"..., 10485760) = 10485760 <0.004469>
23640 01:12:33.700482 close(0)          = 0 <0.000016>
23640 01:12:33.700542 close(1)          = 0 <0.000007>
23640 01:12:33.700628 open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 0 <0.000033>
23640 01:12:33.700711 fstat(0, {st_mode=S_IFREG|0644, st_size=2502, ...}) = 0 <0.000006>
23640 01:12:33.700748 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb48f025000 <0.000015>
23640 01:12:33.700795 read(0, "# Locale name alias data base.\n#"..., 4096) = 2502 <0.000010>
23640 01:12:33.700842 read(0, "", 4096) = 0 <0.000005>
23640 01:12:33.700866 close(0)          = 0 <0.000005>
23640 01:12:33.700886 munmap(0x7fb48f025000, 4096) = 0 <0.000012>
23640 01:12:33.700928 open("/usr/share/locale/ja_JP.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (そのようなファイルやディレクトリはありません) <0.000006>
23640 01:12:33.700955 open("/usr/share/locale/ja_JP.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (そのようなファイルやディレクトリはありません) <0.000005>
23640 01:12:33.700978 open("/usr/share/locale/ja_JP/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (そのようなファイルやディレクトリはありません) <0.000006>
23640 01:12:33.701001 open("/usr/share/locale/ja.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (そのようなファイルやディレクトリはありません) <0.000005>
23640 01:12:33.701023 open("/usr/share/locale/ja.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (そのようなファイルやディレクトリはありません) <0.000005>
23640 01:12:33.701045 open("/usr/share/locale/ja/LC_MESSAGES/coreutils.mo", O_RDONLY) = 0 <0.000007>
23640 01:12:33.701068 fstat(0, {st_mode=S_IFREG|0644, st_size=235868, ...}) = 0 <0.000004>
23640 01:12:33.701088 mmap(NULL, 235868, PROT_READ, MAP_PRIVATE, 0, 0) = 0x7fb48efe4000 <0.000006>
23640 01:12:33.701109 close(0)          = 0 <0.000003>
23640 01:12:33.701154 open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 0 <0.000008>
23640 01:12:33.701180 fstat(0, {st_mode=S_IFREG|0644, st_size=26254, ...}) = 0 <0.000004>
23640 01:12:33.701200 mmap(NULL, 26254, PROT_READ, MAP_SHARED, 0, 0) = 0x7fb48efdd000 <0.000006>
23640 01:12:33.701228 close(0)          = 0 <0.000005>
23640 01:12:33.701267 write(2, "30+0 \343\203\254\343\202\263\343\203\274\343\203\211\345\205\245\345\212\233\n30+0 \343\203\254"..., 48) = 48 <0.000022>
23640 01:12:33.701316 write(2, "314572800 \343\203\220\343\202\244\343\203\210 (315 MB) \343\202\263"..., 53) = 53 <0.000007>
23640 01:12:33.701361 write(2, "\343\200\201 86.4357 \347\247\222\343\200\201 3.6 MB/\347\247\222\n", 30) = 30 <0.000008>
23640 01:12:33.701393 close(2)          = 0 <0.000004>
23640 01:12:33.701417 exit_group(0)     = ?
23640 01:12:33.702334 +++ exited with 0 +++

 

# cat /tmp/2.out_freeze
23640 01:11:07.194839 execve("/usr/bin/dd", ["dd", "if=/dev/zero", "of=/testlv/hoge", "bs=10M", "count=30"], 0x7fff020b9980 /* 25 vars */) = 0 <0.000260>
23640 01:11:07.195323 brk(NULL)         = 0x22a9000 <0.000009>
23640 01:11:07.195391 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb48f026000 <0.000010>
23640 01:11:07.195452 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (そのようなファイルやディレクトリはありません) <0.000012>
23640 01:11:07.195688 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 <0.000013>
23640 01:11:07.195747 fstat(3, {st_mode=S_IFREG|0644, st_size=20200, ...}) = 0 <0.000008>
23640 01:11:07.195804 mmap(NULL, 20200, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb48f021000 <0.000010>
23640 01:11:07.195844 close(3)          = 0 <0.000008>
23640 01:11:07.195888 open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 <0.000014>
23640 01:11:07.195933 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\34\2\0\0\0\0\0"..., 832) = 832 <0.000009>
23640 01:11:07.195979 fstat(3, {st_mode=S_IFREG|0755, st_size=2116736, ...}) = 0 <0.000008>
23640 01:11:07.196022 mmap(NULL, 3932672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb48ea47000 <0.000010>
23640 01:11:07.196061 mprotect(0x7fb48ebfd000, 2097152, PROT_NONE) = 0 <0.000012>
23640 01:11:07.196101 mmap(0x7fb48edfd000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b6000) = 0x7fb48edfd000 <0.000014>
23640 01:11:07.196149 mmap(0x7fb48ee03000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb48ee03000 <0.000011>
23640 01:11:07.196194 close(3)          = 0 <0.000008>
23640 01:11:07.196249 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb48f020000 <0.000009>
23640 01:11:07.196296 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb48f01e000 <0.000009>
23640 01:11:07.196341 arch_prctl(ARCH_SET_FS, 0x7fb48f01e740) = 0 <0.000008>
23640 01:11:07.196457 mprotect(0x7fb48edfd000, 16384, PROT_READ) = 0 <0.000012>
23640 01:11:07.196501 mprotect(0x610000, 4096, PROT_READ) = 0 <0.000010>
23640 01:11:07.196542 mprotect(0x7fb48f027000, 4096, PROT_READ) = 0 <0.000010>
23640 01:11:07.196580 munmap(0x7fb48f021000, 20200) = 0 <0.000015>
23640 01:11:07.196654 rt_sigaction(SIGUSR1, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 <0.000008>
23640 01:11:07.196699 rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 <0.000007>
23640 01:11:07.196737 rt_sigaction(SIGUSR1, {sa_handler=0x403cd0, sa_mask=[INT USR1], sa_flags=SA_RESTORER, sa_restorer=0x7fb48ea7c250}, NULL, 8) = 0 <0.000008>
23640 01:11:07.196776 rt_sigaction(SIGINT, {sa_handler=0x403cc0, sa_mask=[INT USR1], sa_flags=SA_RESTORER|SA_NODEFER|SA_RESETHAND, sa_restorer=0x7fb48ea7c250}, NULL, 8) = 0 <0.000007>
23640 01:11:07.196887 brk(NULL)         = 0x22a9000 <0.000007>
23640 01:11:07.196921 brk(0x22ca000)    = 0x22ca000 <0.000009>
23640 01:11:07.196957 brk(NULL)         = 0x22ca000 <0.000007>
23640 01:11:07.196998 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 <0.000013>
23640 01:11:07.197043 fstat(3, {st_mode=S_IFREG|0644, st_size=106070960, ...}) = 0 <0.000008>
23640 01:11:07.197085 mmap(NULL, 106070960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb48851e000 <0.000010>
23640 01:11:07.197127 close(3)          = 0 <0.000007>
23640 01:11:07.197213 open("/dev/zero", O_RDONLY) = 3 <0.000014>
23640 01:11:07.197270 dup2(3, 0)        = 0 <0.000008>
23640 01:11:07.197307 close(3)          = 0 <0.000007>
23640 01:11:07.197341 lseek(0, 0, SEEK_CUR) = 0 <0.000007>
23640 01:11:07.197375 open("/testlv/hoge", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 <0.068116>
23640 01:11:07.265554 dup2(3, 1)        = 1 <0.000008>
23640 01:11:07.265614 close(3)          = 0 <0.000005>
23640 01:11:07.265673 mmap(NULL, 10498048, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb487b1b000 <0.000031>
23640 01:11:07.265753 read(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"..., 10485760) = 10485760 <0.004147>
23640 01:11:07.269974 write(1, "\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"..., 10485760) = 10485760 <0.005652>
23640 01:11:07.275725 read(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"..., 10485760) = 10485760 <0.001211>
23640 01:11:07.277029 write(1, "\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"..., 10485760) = 10485760 <0.005426>
23640 01:11:07.282537 read(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"..., 10485760) = 10485760 <0.001186>
23640 01:11:07.283814 write(1, "\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"..., 10485760) = 10485760 <0.005372>
23640 01:11:07.289281 read(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"..., 10485760) = 10485760 <0.001200>
23640 01:11:07.290579 write(1, "\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"..., 10485760) = 10485760 <0.005329>
23640 01:11:07.295982 read(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"..., 10485760) = 10485760 <0.001292>
23640 01:11:07.297351 write(1, "\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"..., 10485760) = 10485760 <0.005196>
23640 01:11:07.302679 read(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"..., 10485760) = 10485760 <0.001254>
23640 01:11:07.304036 write(1, "\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"..., 10485760
#

 

 

ちなみに、

# strace -ttT -f -o /tmp/f.out xfs_freeze -f /testlv

# grep mprotect /tmp/f.out

24266 07:46:23.302617 mprotect(0x7f271a431000, 2097152, PROT_NONE) = 0 <0.000012>
24266 07:46:23.302924 mprotect(0x7f271a20a000, 2097152, PROT_NONE) = 0 <0.000012>
24266 07:46:23.303277 mprotect(0x7f2719ffd000, 2097152, PROT_NONE) = 0 <0.000012>
24266 07:46:23.303657 mprotect(0x7f271a1fd000, 16384, PROT_READ) = 0 <0.000013>
24266 07:46:23.303705 mprotect(0x7f271a40a000, 4096, PROT_READ) = 0 <0.000010>
24266 07:46:23.303786 mprotect(0x7f271a631000, 16384, PROT_READ) = 0 <0.000011>
24266 07:46:23.303837 mprotect(0x6dc000, 4096, PROT_READ) = 0 <0.000010>
24266 07:46:23.303880 mprotect(0x7f271a855000, 4096, PROT_READ) = 0 <0.000011>
24267 07:46:23.311354 mprotect(0x7fc636a9c000, 2097152, PROT_NONE) = 0 <0.000013>
24267 07:46:23.311721 mprotect(0x7fc636c9c000, 16384, PROT_READ) = 0 <0.000012>
24267 07:46:23.311767 mprotect(0x605000, 4096, PROT_READ) = 0 <0.000010>
24267 07:46:23.311807 mprotect(0x7fc636ec6000, 4096, PROT_READ) = 0 <0.000010>
24268 07:46:23.317123 mprotect(0x7f6701ced000, 2093056, PROT_NONE) = 0 <0.000011>
24268 07:46:23.317409 mprotect(0x7f6701a6c000, 2097152, PROT_NONE) = 0 <0.000011>
24268 07:46:23.317757 mprotect(0x7f6701c6c000, 16384, PROT_READ) = 0 <0.000011>
24268 07:46:23.317822 mprotect(0x7f6701eec000, 4096, PROT_READ) = 0 <0.000009>
24268 07:46:23.317863 mprotect(0x607000, 4096, PROT_READ) = 0 <0.000009>
24268 07:46:23.317901 mprotect(0x7f670210d000, 4096, PROT_READ) = 0 <0.000009>
24269 07:46:23.320909 mprotect(0x7ffa7d127000, 2097152, PROT_NONE) = 0 <0.000011>
24269 07:46:23.321219 mprotect(0x7ffa7cee0000, 2097152, PROT_NONE) = 0 <0.000012>
24269 07:46:23.321582 mprotect(0x7ffa7cb25000, 2097152, PROT_NONE) = 0 <0.000011>
24269 07:46:23.321854 mprotect(0x7ffa7d0e0000, 16384, PROT_READ) = 0 <0.000011>
24269 07:46:23.321922 mprotect(0x7ffa7cd25000, 16384, PROT_READ) = 0 <0.000010>
24269 07:46:23.322068 mprotect(0x7ffa7d327000, 8192, PROT_READ) = 0 <0.000010>
24269 07:46:23.322107 mprotect(0x61c000, 4096, PROT_READ) = 0 <0.000009>
24269 07:46:23.322145 mprotect(0x7ffa7d550000, 4096, PROT_READ) = 0 <0.000010>

 

mprotect ()は区間 [addr ,addr +len -1] の一部またはすべてを含む メモリページの所望のアクセス保護を指定する。 指定したアクセス保護で禁止されたアクセスを行なうと、 プログラムは SIGSEGV を受信する。

prot は以下の値のビットごとの論理和 (bitwize-or) である:

 ・PROT_NONE:そのメモリには全くアクセスできない。

 ・PROT_READ:そのメモリを読み取ることができる。

 ・PROT_WRITE:そのメモリに書き込むことができる。

 ・PROT_EXEC:そのメモリに実行コードを含むことができる。

新しいアクセス保護はそれまでのアクセス保護を置き換える。 例えば、それまで PROT_READ と設定されているメモリ領域に対して、 prot を PROT_WRITE として mprotect () を呼び出すと、 その領域はもはや読み取り可能ではなくなる。

https://linuxjm.osdn.jp/html/LDP_man-pages/man2/mprotect.2.html