ニフクラにalmalinux導入テスト(DISK追加)

200GB ext4で追加 フラッシュディスクA



[root@localhost ~]# for i in $(find /sys/class/scsi_host -name 'scan') $(find /sys/devices -name 'scan') ;do echho "- - -" > $i ; done
[root@localhost ~]#
[root@localhost ~]# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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
Disklabel type: dos
Disk identifier: 0x0753bacb

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1050623 1048576 512M 83 Linux
/dev/sda2 1050624 5351423 4300800 2.1G 82 Linux swap / Solaris
/dev/sda3 5351424 62914559 57563136 27.5G 83 Linux


Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 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
[root@localhost ~]#
[root@localhost ~]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.32.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 0xf8e92301.

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

Using default response p.
Partition number (1-4, default 1):
First sector (2048-419430399, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-419430399, default 419430399):

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

Command (m for help): p
Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 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
Disklabel type: dos
Disk identifier: 0xf8e92301

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 419430399 419428352 200G 83 Linux

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

[root@localhost ~]# partprobe
[root@localhost ~]# mkfs -t ext4 /dev/sdb1
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 52428544 4k blocks and 13107200 inodes
Filesystem UUID: 41a1edf5-e7bc-47f2-8b2a-c1e43bd29db2
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

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

[root@localhost ~]#
[root@localhost /]# mkdir /add_disk1
[root@localhost /]#
[root@localhost /]# blkid
/dev/sda3: UUID="ああああああああああああああああああ" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="あああああ*"
/dev/sda1: UUID="ああああああああああああああああああ" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="あああああ*"
/dev/sda2: UUID="ああああああああああああああああああ" TYPE="swap" PARTUUID="あああああ*"
/dev/sdb1: UUID="ああああああああああああああああああ" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="あああああ*"
[root@localhost /]#
[root@localhost /]# vi /etc/fdtab
"/etc/fdtab" [New File]~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ :q[root@localhost /]# vi /etc/fdtabstab
"/etc/fstab" 14L, 615C#
# /etc/fstab
# Created by anaconda on Mon Jan 4 02:33:20 2021
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=ああああああああああああああああああ /xfs defaults0 0
UUID=ああああああああああああああああああ /bootxfs defaults0 0
UUID=ああああああああああああああああああ noneswap defaults0 0
~ ~ ~ ~ ~ ~ ~ ~ ~

#
# /etc/fstab
# Created by anaconda on Mon Jan 4 02:33:20 2021
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=ああああああああああああああああああ /xfs defaults 0 0
UUID=ああああああああああああああああああ /bootxfs defaults 0 0
UUID=ああああああああああああああああああ noneswap defaults 0 0
UUID=ああああああああああああああああああ /add_disk1 ext4 defaults 1 2

[root@localhost /]#
[root@localhost /]# mount /dev/sdb1 /add_disk1
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs 3.8G 17M 3.8G 1% /run
tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/sda3 28G 2.3G 26G 9% /
/dev/sda1 507M 280M 228M 56% /boot
tmpfs 775M 0 775M 0% /run/user/0
/dev/sdb1 196G 61M 186G 1% /add_disk1
[root@localhost /]#

この記事が気に入ったらサポートをしてみませんか?