2.6
2024
手动将Liunx系统的系统分区格式化
目前手边一台行业定制服务器系统在桌面环境使用自带面板备份系统分区总是提示失败,并且系统分区不提供格式化操作选项,拔硬盘去windows操作又太麻烦,因为这台该死的服务器拔硬盘需要拆机拧螺丝拔Sata线和供电电源。
是不是听起来很繁琐?那么在泛Liunx系统中是否存在着与Windows当中能实现相同功能的软件?
没错,确实存在,使用mkfs命令和fdisk命令可以在Liunx系统中对分区实现创建等操作,但由于系统版本太过古老,这里我使用了mkfs进行实现,下面是操作实例记录。
#blkid 查看系统所有已挂载与未挂载分区 /dev/sdj2: LABEL="RESOURCE" UUID="0a3d56cd-5d6b-4d03-be66-79ed5d935967" /dev/sdj1: UUID="4e205ac8-d809-4c22-b1ad-872c27e282d1" /dev/sdi2: LABEL="RESOURCE" UUID="ea332f46-4304-42cb-a2d6-f7b76d66a6a1" /dev/sdi1: LABEL="ROOT_EVS8000" UUID="7b31ca08-fe9f-4f23-ac75-d94d7d30bed8" /dev/sdh1: UUID="72d15755-c2c0-4505-9893-a6647297c379" /dev/sdg1: UUID="a7d57a3d-1b80-481e-a868-353ef2466e7b" /dev/sdf2: LABEL="RESOURCE" UUID="adb88a87-3433-4a85-8b8c-1756a7bc5ace" /dev/sdf1: LABEL="ROOT_EVS8000" UUID="84d9199a-88c0-428d-8538-f0d09c3157dc" /dev/sde2: LABEL="RESOURCE" UUID="e9bd48aa-ed54-49c4-99f0-0c0e670b1cfc" /dev/sde1: LABEL="ROOT_EVS8000_USE" UUID="6bb0a0d3-c7d4-403d-ba77-db35af7b03db" /dev/sdd1: UUID="1369f4bd-8a89-4eda-978f-06fa7d696ab8" /dev/sdc2: LABEL="RESOURCE" UUID="159f5416-d28b-40d3-9a2b-9ca758abf9a5" /dev/sdc1: LABEL="ROOT_EVS8000" UUID="fa30fc32-9028-4491-b52b-3986531a0b1b" /dev/sdb1: UUID="8e6edcae-c476-4283-ac38-950c4f9caff0" /dev/sda1: UUID="1bd318e3-cf68-41dd-84b1-d8cb55557d2e" 桌面-控制面板查看需要格式化分区的分区逻辑路径 /dev/sdj1 使用mkfs -t ext4 /dev/sjd1 将/dev/sdj1分区格式化为ext4格式分区 # mkfs.ext4 /dev/sdj1 mke2fs 1.43.4 (31-Jan-2017) /dev/sdj1 contains a ext4 file system labelled 'ROOT_EVS8000' last mounted on /tmp/backupdest on Mon Feb 5 15:57:01 2024 Proceed anyway? (y,N) y /dev/sdj1 alignment is offset by 3072 bytes. This may result in very poor performance, (re)-partitioning suggested. Creating filesystem with 24414058 4k blocks and 6111232 inodes Filesystem UUID: 4e205ac8-d809-4c22-b1ad-872c27e282d1 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 (131072 blocks): done Writing superblocks and filesystem accounting information: done 使用sync命令强制将内存中的缓存同步至磁盘文件 格式化完成后给这个分区加个label(卷标)让服务器识别为 系统/资源 分区 系统:e2label /dev/sdj1 ROOT_EVS8000 资源:e2label /dev/sdj1 RESOURCE |
附:/evideo/etc/disklabel.conf
############################################
#function: define disk label of different system
#author: kyj
#modify time: 2014-01-10
###########################################
#EVS8000 disklabel
ROOT_LABEL_USE=ROOT_EVS8000_USE
SYS_LABEL_USE=SYS_EVS8000_USE
DB_LABEL_USE=DB_EVS8000_USE
ROOT_LABEL=ROOT_EVS8000
SYS_LABEL=SYS_EVS8000
DB_LABEL=DB_EVS8000
RESOURCE_LABEL=RESOURCE
上一篇
下一篇