淘了一台星际蜗牛a款做服务器数据的本地备份服务器(centos7.2/1T)

1 什么是蜗牛星际请自行百度,我花400块买的,千兆网口的a款,这个机器的配置其实就是个NAS配置的机器,搞不懂为什么那么多人会专门花钱买来挖矿,这机器的CPU浮点计算能力很差的,崩盘了也是理所当然,稍微懂行点儿的恐怕都会有疑问…可惜就没人说真话…又是一个悲伤的故事

以下是a款照片,去电脑城淘的,比市场价贵了百把块钱,但是买之前拆开好好看了,成色很好,基本没怎么用的机器,以下是照片(内部没有拍),商家那里有centos安装镜像和引导工具,所以让其直接给我装了centos 7.2 64bit,然后我直接抱回了家


晚上就用这黑木头HDMI接口接上家里的液晶电视后开搞,直接连接上网线你会发现根本连不上网络,所以首先需要对这个黑疙瘩的网络进行配置

注意修改网卡配置(以下是根据我自己家里的网络修改的网络配置信息,个人家里的可能不同,请注意ifcfg-enp3s0是我的机器装了系统后自动生成的配置文件,每个人安装好后enp后面几个字母不一样,单网卡就是这个的配置文件)

1
vi /etc/sysconfig/network-scripts/ifcfg-enp3s0

修改为

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp3s0
UUID=26abf0a6-e2d3-485a-94c4-42b61940ceca
DEVICE=enp3s0
ONBOOT=yes
BROADCAST=192.168.1.255
IPADDR=192.168.1.66
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.1
#DNS1=8.8.8.8
#DNS2=114.114.114.114
1
systemctl restart network

然后更换了阿里源,然后yum update后安装所需的软件,比如screen什么的
然后对外网网站什么的进行ping测试看网络好了没有,比如ping下某东/某宝/某度
不行就reboot下

接下来开始折腾吧,配置好网络后,就可以像其他服务器一样使用xshell登录了,IP就是局域网分配给机器的IP,root账户,密码你自己系统的密码不清楚吗?

手里两个1T硬盘,把其中一个1T的移动硬盘拆出来装进了星际蜗牛,
准备格式化后组LVM卷为以后扩充空间做好准备
由于硬盘之前是用作移动硬盘,分区为NTFS,所以要对硬盘重新格式化分区后再挂载
注意,linux对win系统拆下来的硬盘只能认出MBR引导分区,其他的分期用fdisk -l是看不到的
此处涉及GPT文件格式和parted格式化命令,请自行百度是什么意思

以下为重新格式化后分区的笔记

1
2
3
4
5
6
7
8
9
10
[root@localhost /]# parted /dev/sdb
GNU Parted 3.1
使用 /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA ST1000LM024 HN-M (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name 标志
1 1049kB 1050MB 1049MB ext4 Basic data partition 隐藏分区, diag
2 1050MB 1322MB 273MB fat32 EFI system partition 启动, 隐藏分区
3 1322MB 2371MB 1049MB fat32 Basic data partition 隐藏分区
4 2371MB 2505MB 134MB Microsoft reserved partition msftres
5 2505MB 109GB 106GB ntfs Basic data partition
6 109GB 110GB 1048MB ntfs 隐藏分区, diag
7 110GB 988GB 878GB ntfs Basic data partition
8 988GB 1000GB 12.2GB ntfs Basic data partition 隐藏分区, diag

(parted) mklabel
新的磁盘标签类型? gpt
警告: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
是/Yes/否/No? yes
(parted) p
Model: ATA ST1000LM024 HN-M (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name 标志

(parted)mkpart
分区名称? []? gpt1
文件系统类型? [ext2]? ext4
起始点? 0
结束点? 999G
警告: The resulting partition is not properly aligned for best performance.
忽略/Ignore/放弃/Cancel? cancel
(parted) mkpart
分区名称? []? gpt1
文件系统类型? [ext2]? ext4
起始点? 0kb
结束点? 1000G
警告: You requested a partition from 0.00B to 1000GB (sectors 0..1953125000).
The closest location we can manage is 17.4kB to 1000GB (sectors 34..1953525134).
Is this still acceptable to you?
是/Yes/否/No? yes
警告: The resulting partition is not properly aligned for best performance.
忽略/Ignore/放弃/Cancel? ignore
(parted) p
Model: ATA ST1000LM024 HN-M (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name 标志
1 17.4kB 1000GB 1000GB gpt1

(parted) q
信息: You may need to update /etc/fstab.

您在 /var/spool/mail/root 中有新邮件
[root@localhost /]#fdisk -l

磁盘 /dev/sda:16.0 GB, 16013942784 字节,31277232 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x0006bdab

设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 31277055 14588928 8e Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

磁盘 /dev/sdb:1000.2 GB, 1000204886016 字节,1953525168 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:gpt
Disk identifier: 56F9A5A7-DD33-4FCD-8AE0-F9821A84B6F6

# Start End Size Type Name
1 34 1953525134 931.5G Microsoft basic gpt1
Partition 1 does not start on physical sector boundary.

磁盘 /dev/mapper/centos-root:13.3 GB, 13333692416 字节,26042368 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘 /dev/mapper/centos-swap:1602 MB, 1602224128 字节,3129344 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

[root@localhost /]# mkfs.ext4 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
/dev/sdb1 alignment is offset by 3072 bytes.
This may result in very poor performance, (re)-partitioning suggested.
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61054976 inodes, 244190637 blocks
12209531 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2392850432
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848

Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成

创建LVM

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@localhost tools]# pvcreate /dev/sdb1
WARNING: ext4 signature detected on /dev/sdb1 at offset 1080. Wipe it? [y/n]: y
Wiping ext4 signature on /dev/sdb1.
Physical volume "/dev/sdb1" successfully created.
[root@localhost tools]# vgcreate vg_data /dev/sdb1
Volume group "vg_data" successfully created
[root@localhost tools]# lvcreate -l 100%FREE -n lv_data vg_data
Logical volume "lv_data" created.
[root@localhost tools]# mkfs.ext4 /dev/vg_data/lv_data
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61054976 inodes, 244190208 blocks
12209510 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2392850432
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848

Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成

注意上面一步: 一定要格式化完成后再挂载,不然报不可写的错误
[root@localhost tools]# echo ‘/dev/mapper/vg_data-lv_data /webbackup ext4 defaults 0 0’ >> /etc/fstab
[root@localhost tools]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun Oct 27 17:35:06 2019
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=1aa45c5c-584d-414b-8da1-ff56694feedc /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/mapper/vg_data-lv_data /webbackup ext4 defaults 0 0
[root@localhost tools]# mount -a
[root@localhost tools]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs 1.8G 0 1.8G 0% /dev/shm
tmpfs 1.8G 8.9M 1.8G 1% /run
tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup
/dev/mapper/centos-root 13G 1.4G 12G 11% /
/dev/sda1 1014M 192M 823M 19% /boot
tmpfs 369M 0 369M 0% /run/user/0
/dev/mapper/vg_data-lv_data 917G 77M 871G 1% /webbackup

好了 下次接着写LVM扩展存储空间,争取早日将四个硬盘位全部用完,未完待续

原文链接:https://xiaohost.com/3107.html,转载请注明出处。
0

评论1

请先
  1. 不错,必须顶一下!