PanabitNTM指定硬盘用于pcap

Panabit NTM标准版默认安装后,默认只会使用第一块硬盘,如果想指定硬盘用于存放pcap的话,就需要命令行手动指定。

ps:我安装的时候还发现安装程序只创建了ntmlog,没创建ntmpcap目录,一并解决。

首先web界面开启ssh,然后ssh登录,密码不知道,需要到APP商店下个改root密码的应用就行

1
2
3
4
5
6
7
8
9
10
11
12
13
login as: root
root@192.168.0.200's password:
___ _ _
( _`\ ( ) _ ( )_
| |_) ) _ _ ___ _ _ | |_ (_) | ,_)
| ,__/ '/'_` ) /' _ `\ /'_` ) | '_`\ | | | |
| | ( (_| | | ( ) | ( (_| | | |_) ) | | | |_
(_) `\__,_) (_) (_)` \__,_) (_,__/' (_) \__)

---------------------------------------------------------------
Welcome to Panabit. ( Panabit Inc. www.panabit.com)
---------------------------------------------------------------
root@panabit[ ~ ]#

首先,输入fdisk -l获取一下当前硬盘列表

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
root@panabit[ ~ ]# fdisk -l
Disk /dev/sda: 29.51 GiB, 31675383808 bytes, 61865984 sectors
Disk model: BIWIN SSD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x79f7c313

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 8390655 8388608 4G 83 Linux
/dev/sda2 8390656 16779263 8388608 4G 83 Linux
/dev/sda3 16779264 61865983 45086720 21.5G 83 Linux


Disk /dev/sdb: 298.9 GiB, 320072933376 bytes, 625142448 sectors
Disk model: TOSHIBA MK3261GS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@panabit[ ~ ]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.8G 416K 3.8G 1% /run
/dev/sda1 4.0G 278M 3.8G 7% /
/dev/sda2 4.0G 317M 3.7G 8% /log
/dev/sda3 22G 186M 22G 1% /data/ntm
tmpfs 128M 41M 88M 32% /usr/ramdisk
tmpfs 1.0G 257M 768M 26% /usr/ntmlog
tmpfs 5.0M 1.9M 3.2M 37% /usr/msgpipe

我这个机器是sda是一个32G的msata,sdb是这一个320G的机械盘。

如果你的sdb是旧硬盘,需要清除一下数据,也可以在网页上,存储概况 中去格式化一下硬盘。

然后给sdb分区,两个思路,32G的固态硬盘作为ntmlog,320G的sdb作为ntmpcap,或者像我这个固态盘比较垃圾的话,就都给sdb用作ntmlog和ntmpcap,由于标准版授权最大250G存储空间,所以320G足够用了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
root@panabit[ ~ ]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.35.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x010f447f.

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-625142447, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-625142447, default 625142447): 64G
Value out of range.
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-625142447, default 625142447): +64G

Created a new partition 1 of type 'Linux' and of size 64 GiB.

Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (2-4, default 2):
First sector (134219776-625142447, default 134219776):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (134219776-625142447, default 625142447):

Created a new partition 2 of type 'Linux' and of size 234.1 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

创建完2个分区后,列表看一下硬盘分区情况

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
root@panabit[ ~ ]# fdisk -l
Disk /dev/sda: 29.51 GiB, 31675383808 bytes, 61865984 sectors
Disk model: BIWIN SSD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x79f7c313

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 8390655 8388608 4G 83 Linux
/dev/sda2 8390656 16779263 8388608 4G 83 Linux
/dev/sda3 16779264 61865983 45086720 21.5G 83 Linux


Disk /dev/sdb: 298.9 GiB, 320072933376 bytes, 625142448 sectors
Disk model: TOSHIBA MK3261GS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x010f447f

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 134219775 134217728 64G 83 Linux
/dev/sdb2 134219776 625142447 490922672 234.1G 83 Linux

给2个分区格式化为ext4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
root@panabit[ ~ ]# mkfs.ext4 /dev/sdb1
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 16777216 4k blocks and 4194304 inodes
Filesystem UUID: 66d6fc29-fd5a-4a7b-b343-f5f3d9160da6
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done

root@panabit[ ~ ]# mkfs.ext4 /dev/sdb2
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 61365334 4k blocks and 15343616 inodes
Filesystem UUID: 01422a70-d0bb-47bd-84d4-40abe50998e0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

挂载这两个盘

1
2
root@panabit[ ~ ]# mount -t ext4 /dev/sdb1 /data/ntm
root@panabit[ ~ ]# mount -t ext4 /dev/sdb2 /data/pcap

添加到rc.local

1
2
3
4
vi /etc/rc.local
添加下面两行
mount -t ext4 /dev/sdb1 /data/ntm
mount -t ext4 /dev/sdb2 /data/pcap

最后重启生效。