Storage Management in CentOS7#
External Storage#
- Mobile storage devices: CD, USB flash drive
- Fixed storage devices: Hard drive
Using CD: Install CD (Prepare CentOS7 installation CD)#
Experimental Steps (Core Idea: Mounting)#
- Insert the ISO image into the virtual machine's optical drive
- Create a mounting directory (It is recommended to create the mounting directory under the
media
directory ormnt
directory) - Mount the CD to the specified mounting directory:
mount device name usually under /dev mounting directory
- Access the mounting directory to access the CD
- After use, you can unmount the CD:
umount device name
or
umount mounting directory
Using Hard Drive: Static Disk (Basic Disk)#
Knowledge Point: Understanding partition types
- Primary partition: Numbered 1-4
- Extended partition: Numbered 1-4
- Logical partition: Numbered greater than 5
Characteristics:
- Primary partition + Extended partition <= 4
- 0 or 1 Extended partition
- The space of the Extended partition cannot be used directly. If you want to use it, you need to create a logical partition on it
- The number of logical partitions is unlimited
For example:
- Partition (Partition file:
/dev/sdb
)
Subcommands offdisk
:n
create partition;p
view partition,w
save partition,q
exit partition - Create file system (fat32, ext4):
mkfs.ext4
- Create mounting directories
mnt/disk1
;/mnt/disk2
;/mnt/disk3
- Use
mount
command to mount the partition
To check the mounted devices, simply enter mount
mount
is "temporary": when the host restarts, the system automatically unmounts the device
How to make the device permanently mounted? Solution: Modify the configuration file /etc/fstab
How to make the /etc/fstab
file take effect
Method one, restart the system
Method two, execute mount -a
Format of /etc/fstab
file
Device file Mount point File type Read-write mode (rw,ro) 0 0