First, add a hard disk (SCSI type) to the VM ). Sudo is required to execute some management commands in Ubuntu, which is too troublesome. Directly reset the root password and switch to the root operation. 1. view the partition: fdisk-l/dev/sda (the first hard disk is automatically selected during installation)/dev/sda1Linux (logical partition) /dev/sda2Extend (extended partition)/dev/sda5Linux
First, add a hard disk (SCSI type) to the VM ).
Sudo is required to execute some management commands in Ubuntu, which is too troublesome. Directly reset the root password and switch to the root operation.
1. View partitions:
Fdisk-l
/Dev/sda (the first hard disk, with automatic partitioning selected during installation)
/Dev/sda1 Linux (logical partition)
/Dev/sda2 extended partition)
/Dev/sda5 Linux Swap (temporary Swap zone)
/Dev/sdb (the second hard disk is not partitioned yet, prompting that the partition table is not included)
Physical partitions use a, B... Number. Each physical hard disk can have up to four primary logical partitions (or extended partitions). Therefore, in an automatic partition, the first logical Partition Number in the extended partition sda2 starts from 5.
2. Partition sdb:
Fdisk/dev/sdb
Select m: view the command.
Select n: add a new partition
Select p: Add a logical partition. The default start value is 1. The end value is + 2048 M, that is, 2 GB is allocated to the first logical partition.
Select p: View partitions. A new partition sdb1 is added.
Select w: Keep partition table information
3. format:
Run fdisk-l to view the number of sdb1 instances added to sdb, and then run the format command.
Mkfs-t ext3/dev/sdb1
4. Mount: Put it under/media. You can see this directory on the desktop later.
Mkdir/media/sdb1
Mount/dev/sdb1/media/sdb1
Use df to view (df-m). The size of/dev/sdb1 is 1946, and the directory is/media/sdb1.
5. Add to automatic mounting: Modify/etc/fstab
#/Dev/sdb1
/Dev/sdb1/media/sdb1 ext3 defaults 0 0
6. Restart. A disk is displayed on the desktop.
Shutdown-r now