做课展网站,网络营销策划创意案例点评,网站建设需要软件,网站seo新手文章目录 参考文献查看了一下起点现状分区(base) ~ sudo parted /dev/sdcmklabel gpt#xff08;设置分区类型#xff09;增加分区 格式化需要先退出quit#xff08;可以#xff09;(base) / sudo mkfs.xfs /dev/sdc/sdc1#xff08;失败#xff09;sudo mkfs.xfs /dev/s… 文章目录 参考文献查看了一下起点现状分区(base) ~ sudo parted /dev/sdcmklabel gpt设置分区类型增加分区 格式化需要先退出quit可以(base) / sudo mkfs.xfs /dev/sdc/sdc1失败sudo mkfs.xfs /dev/sdc1成功。sdc1是硬盘标识符分区号和路径写法不同 挂载创建用于挂载的文件夹进行挂载 vi /etc/fstab失败sudo vi /etc/fstab使用超级管理员权限再进行一遍上面操作加载 sudo mount -a设置文件夹权限 参考文献
linux parted非交互式分区实例 —— 筑梦之路 Linux磁盘格式化(mkfs、mkfs.xfs、mkfs.ext4)、Linux文件系统的校验(xfs_repair、fsck_ext4) 【LINUX】磁盘分区、挂载 linux7磁盘挂载大于16T,CentOS6.5挂载超过16T的大容量存储空间格式化为xfs 服务器硬盘安装配置及系统重装操作记录 服务器的硬盘不够大导师新买了块用安装的起点是这样子的
查看了一下起点现状 发现第二块没挂载了但是是别人的硬盘所以就先不管了。
(base) ~ sudo fdisk -l
[sudo] password for cszx:
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.Disk /dev/sda: 239.9 GB, 239902654464 bytes, 468559872 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: AD68530F-9D77-4143-91E1-D222825C2F10# Start End Size Type Name1 2048 411647 200M EFI System EFI System Partition2 411648 2508799 1G Microsoft basic 3 2508800 468557823 222.2G Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.Disk /dev/sdb: 239.9 GB, 239902654464 bytes, 468559872 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 2BB6EFDB-AB43-4872-B56F-88620F6AF0B3# Start End Size Type Name1 34 2047 1007K BIOS boot 2 2048 1050623 512M EFI System 3 1050624 468559838 222.9G Linux LVM Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 4294 MB, 4294967296 bytes, 8388608 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-home: 180.6 GB, 180631896064 bytes, 352796672 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/pve-swap: 8589 MB, 8589934592 bytes, 16777216 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/pve-root: 59.6 GB, 59592671232 bytes, 116391936 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/pve-vm--105--disk--0: 4 MB, 4194304 bytes, 8192 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytesDisk /dev/mapper/pve-vm--105--disk--1: 128.8 GB, 128849018880 bytes, 251658240 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk label type: dos
Disk identifier: 0x00000000Device Boot Start End Blocks Id System
/dev/mapper/pve-vm--105--disk--1p1 1 4294967295 2147483647 ee GPT
Partition 1 does not start on physical sector boundary.Disk /dev/sdc: 14000.5 GB, 14000519643136 bytes, 27344764928 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes分区
(base) ~ sudo parted /dev/sdc
[sudo] password for cszx: GNU Parted 3.1 Using /dev/sdc Welcome to GNU Parted! Type ‘help’ to view a list of commands.
mklabel gpt设置分区类型
增加分区
mkpart primary 0% 25% parted -s /dev/sdc mkpart primary 25% 50% parted -s /dev/sdc mkpart primary 50% 75% parted -s /dev/sdc mkpart primary 75% 100% 两种命令的结果看上去一样采用第一行的形式没有详细信息的输入
(parted) mklabel gpt
(parted) mkpart primary 0% 25%
(parted) parted -s /dev/sdc mkpart primary 25% 50% align-check TYPE N check partition N for TYPE(min|opt) alignmenthelp [COMMAND] print general help, or help on COMMANDmklabel,mktable LABEL-TYPE create a new disklabel (partition table)mkpart PART-TYPE [FS-TYPE] START END make a partitionname NUMBER NAME name partition NUMBER as NAMEprint [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or aparticular partitionquit exit programrescue START END rescue a lost partition near START and ENDresizepart NUMBER END resize partition NUMBERrm NUMBER delete partition NUMBERselect DEVICE choose the device to editdisk_set FLAG STATE change the FLAG on selected devicedisk_toggle [FLAG] toggle the state of FLAG on selected deviceset NUMBER FLAG STATE change the FLAG on partition NUMBERtoggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBERunit UNIT set the default unit to UNITversion display the version number and copyright information of GNU Partedalign-check TYPE N check partition N for TYPE(min|opt) alignmenthelp [COMMAND] print general help, or help on COMMANDmklabel,mktable LABEL-TYPE create a new disklabel (partition table)mkpart PART-TYPE [FS-TYPE] START END make a partitionname NUMBER NAME name partition NUMBER as NAMEprint [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or aparticular partitionquit exit programrescue START END rescue a lost partition near START and ENDresizepart NUMBER END resize partition NUMBERrm NUMBER delete partition NUMBERselect DEVICE choose the device to editdisk_set FLAG STATE change the FLAG on selected devicedisk_toggle [FLAG] toggle the state of FLAG on selected deviceset NUMBER FLAG STATE change the FLAG on partition NUMBERtoggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBERunit UNIT set the default unit to UNITversion display the version number and copyright information of GNU Partedalign-check TYPE N check partition N for TYPE(min|opt) alignmenthelp [COMMAND] print general help, or help on COMMANDmklabel,mktable LABEL-TYPE create a new disklabel (partition table)mkpart PART-TYPE [FS-TYPE] START END make a partitionname NUMBER NAME name partition NUMBER as NAMEprint [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or aparticular partitionquit exit programrescue START END rescue a lost partition near START and ENDresizepart NUMBER END resize partition NUMBERrm NUMBER delete partition NUMBERselect DEVICE choose the device to editdisk_set FLAG STATE change the FLAG on selected devicedisk_toggle [FLAG] toggle the state of FLAG on selected deviceset NUMBER FLAG STATE change the FLAG on partition NUMBERtoggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBERunit UNIT set the default unit to UNITversion display the version number and copyright information of GNU Parted可以了 查看
格式化
在parted内mkfs.xfs /dev/sdc/sdc1失败
(parted) mkfs.xfs /dev/sdc/sdc1 align-check TYPE N check partition N for TYPE(min|opt) alignmenthelp [COMMAND] print general help, or help on COMMANDmklabel,mktable LABEL-TYPE create a new disklabel (partition table)mkpart PART-TYPE [FS-TYPE] START END make a partitionname NUMBER NAME name partition NUMBER as NAMEprint [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or aparticular partitionquit exit programrescue START END rescue a lost partition near START and ENDresizepart NUMBER END resize partition NUMBERrm NUMBER delete partition NUMBERselect DEVICE choose the device to editdisk_set FLAG STATE change the FLAG on selected devicedisk_toggle [FLAG] toggle the state of FLAG on selected deviceset NUMBER FLAG STATE change the FLAG on partition NUMBERtoggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBERunit UNIT set the default unit to UNITversion display the version number and copyright information of GNU Partedalign-check TYPE N check partition N for TYPE(min|opt) alignmenthelp [COMMAND] print general help, or help on COMMANDmklabel,mktable LABEL-TYPE create a new disklabel (partition table)mkpart PART-TYPE [FS-TYPE] START END make a partitionname NUMBER NAME name partition NUMBER as NAMEprint [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or aparticular partitionquit exit programrescue START END rescue a lost partition near START and ENDresizepart NUMBER END resize partition NUMBERrm NUMBER delete partition NUMBERselect DEVICE choose the device to editdisk_set FLAG STATE change the FLAG on selected devicedisk_toggle [FLAG] toggle the state of FLAG on selected deviceset NUMBER FLAG STATE change the FLAG on partition NUMBERtoggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBERunit UNIT set the default unit to UNITversion display the version number and copyright information of GNU Parted需要先退出quit可以
(base) / sudo mkfs.xfs /dev/sdc/sdc1失败
[sudo] password for cszx: /dev/sdc/sdc1: Not a directory
sudo mkfs.xfs /dev/sdc1成功。sdc1是硬盘标识符分区号和路径写法不同
meta-data/dev/sdc1 isize512 agcount4, agsize213630912 blks sectsz4096 attr2, projid32bit1 crc1 finobt0, sparse0
data bsize4096 blocks854523648, imaxpct5 sunit0 swidth0 blks
naming version 2 bsize4096 ascii-ci0 ftype1
log internal log bsize4096 blocks417247, version2 sectsz4096 sunit1 blks, lazy-count1
realtime none extsz4096 blocks0, rtextents0sudo mkfs.xfs /dev/sdc2 sudo mkfs.xfs /dev/sdc3 sudo mkfs.xfs /dev/sdc4
(base) / sudo mkfs.xfs /dev/sdc2
[sudo] password for cszx:
meta-data/dev/sdc2 isize512 agcount4, agsize213630976 blks sectsz4096 attr2, projid32bit1 crc1 finobt0, sparse0
data bsize4096 blocks854523904, imaxpct5 sunit0 swidth0 blks
naming version 2 bsize4096 ascii-ci0 ftype1
log internal log bsize4096 blocks417248, version2 sectsz4096 sunit1 blks, lazy-count1
realtime none extsz4096 blocks0, rtextents0
^[[A%
(base) / sudo mkfs.xfs /dev/sdc3
meta-data/dev/sdc3 isize512 agcount4, agsize213630976 blks sectsz4096 attr2, projid32bit1 crc1 finobt0, sparse0
data bsize4096 blocks854523904, imaxpct5 sunit0 swidth0 blks
naming version 2 bsize4096 ascii-ci0 ftype1
log internal log bsize4096 blocks417248, version2 sectsz4096 sunit1 blks, lazy-count1
realtime none extsz4096 blocks0, rtextents0
(base) / sudo mkfs.xfs /dev/sdc4
meta-data/dev/sdc4 isize512 agcount4, agsize213630912 blks sectsz4096 attr2, projid32bit1 crc1 finobt0, sparse0
data bsize4096 blocks854523648, imaxpct5 sunit0 swidth0 blks
naming version 2 bsize4096 ascii-ci0 ftype1
log internal log bsize4096 blocks417247, version2 sectsz4096 sunit1 blks, lazy-count1
realtime none extsz4096 blocks0, rtextents0
(base) /
查看可以了
挂载
创建用于挂载的文件夹
mkdir c1 mkdir c2 mkdir c3 mkdir c4
进行挂载 vi /etc/fstab失败 加入四行 /dev/sdc1 /home/cszx/c1 xfs defaults 0 0 /dev/sdc2 /home/cszx/c2 xfs defaults 0 0 /dev/sdc3 /home/cszx/c3 xfs defaults 0 0 /dev/sdc4 /home/cszx/c4 xfs defaults 0 0 保存并退出:wq! 报错/etc/fstab E212: Can’t open file for writing 原因是权限不够退出:q!
sudo vi /etc/fstab使用超级管理员权限再进行一遍上面操作 保存并退出:wq!
加载 sudo mount -a
查看 成功了。 发现需要使用sudo权限mkdir: cannot create directory ‘zgp’: Permission denied
设置文件夹权限
sudo chmod 777 /home/cszx/c1 sudo chmod 777 /home/cszx/c2 sudo chmod 777 /home/cszx/c3 sudo chmod 777 /home/cszx/c4