|
Operating System: RHEL6.4 - 64
Increase 30G disk Linux operating system (virtual machine) in
Partition, the first primary partition 18G, formatted as ext4 file system, hanging on to the / u01
To implement a system reboot is still valid (boot automatically mount) be mounted using LABEL
1.1.1 confirm the system disk device
df -Th view the current file system usage
[Root @ rhel64 ~] # df -Th
View the current disk partitioning and equipment
[Root @ rhel64 ~] # fdisk -cul
1.1.2 increase 30G SCSI disk
Shut down the operating system
[Root @ rhel64 ~] # shutdown -h now
Add a SCSI storage controller
Add a 30G disk in the SCSI controller
Add a disk is complete, start the virtual machine operating system.
1.1.3 Check Device disk case
[Root @ rhel64 ~] # fdisk -cul
After each restart, the disk name may vary.
After the reboot, the newly added disk name is / dev / sda
1.1.4 partition fdisk
See the newly added disk partitioning
[Root @ rhel64 ~] # fdisk -cul / dev / sda
[Root @ rhel64 ~] # fdisk / dev / sda
Tip recommended cu, press m help, q quit
Re-partition mode using fdisk -cu
[Root @ rhel64 ~] # fdisk -cu / dev / sda
m View command help
n Add a new partition p primary partition 1 first sector carriage laster sector input default partition size + 18G
m View help p Print the partition table
m View help save the partition table w
See the new disk partitioning again
[Root @ rhel64 ~] # fdisk -cul / dev / sda
See the corresponding device
[Root @ rhel64 ~] # ll / dev / sda *
1.1.5 Formatting mkfs.ext4
Enterprise Edition 6 default ext4 file system
[Root @ rhel64 ~] # mkfs.ext4 / dev / sda1
1.1.6 playing tag e2label
[Root @ rhel64 ~] # e2label
[Root @ rhel64 ~] # e2label / dev / sda1 u01
Check the label, UUID
[Root @ rhel64 ~] # blkid
1.1.7 Create the mount point
Essence mount point is a directory entry is accessed disk partition
[Root @ rhel64 ~] # mkdir / u01
[Root @ rhel64 ~] # ls -ld / u01
1.1.8 temporary mount
Create the file file1 in front mount / u01 in
[Root @ rhel64 ~] # touch / u01 / file1
[Root @ rhel64 ~] # ll / u01
View the file system, then the / u01 just an ordinary directory, occupancy / file system space
[Root @ rhel64 ~] # df -Th
Use the mount command to mount / dev / sda1 to / u01
[Root @ rhel64 ~] # mount / dev / sda1 / u01
[Root @ rhel64 ~] # df -Th
Once mounted / u01 is a separate file system, corresponding to a hard disk partition, with its own separate disk space
View / u01, file1 file does not already display
[Root @ rhel64 ~] # ll / u01
1.1.9 unmount the file system
Before uninstalling, the new file file2 in / u01 in
[Root @ rhel64 ~] # touch / u01 / file2
[Root @ rhel64 ~] # ll / u01
Uninstall / u01 Document System / u01 files, display does not show the previous file1 file2
[Root @ rhel64 ~] # umount / u01
[Root @ rhel64 ~] # df -Th
[Root @ rhel64 ~] # ll / u01
1.1.10 written to / etc / fstab for system startup automatically mount
Check the configuration file / etc / fstab
[Root @ rhel64 ~] # cat / etc / fstab
Backup configuration file, and add a new entry in the configuration file
[Root @ rhel64 ~] # cp / etc / fstab /etc/fstab.bak
[Root @ rhel64 ~] # vi / etc / fstab
G quickly move the cursor to the last row o the next line is inserted, you can use the Tab key to separate the alignment
LABEL = u01 / u01 ext4 defaults 0 0
You can use the LABEL to mount, you can use UUID to mount.
Do not use the following method to mount! ! !
The current state is not the problem, reboot, disk name may change after the newly added disk 30G restart may become / dev / sdb !!!
/ Dev / sda1 / u01 ext4 defaults 0 0
Check the file system, the use mount / u01 mount, if the / etc / fstab is configured correctly, properly mount
[Root @ rhel64 ~] # df -Th
[Root @ rhel64 ~] # mount / u01
[Root @ rhel64 ~] # df -Th
[Root @ rhel64 ~] # ll / u01
1.1.11 operating system shutdown, restart verification
[Root @ rhel64 ~] # shutdown -h now
[Root @ rhel64 ~] # df -Th
/ U01 file system can be displayed, indicating a successful restart automatically mount.
Note: At this point / u01 corresponding partition is shown as / dev / sdb1, explained after the shutdown restart, 30G disk name is / dev / sdb!
There may still be / dev / sda, depending on the disk in response to the order to determine the name. |
|
|
|