Article Title: resize a hard disk in a Linux operating system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Note: The machine must be shut down first and then inserted into the hard disk. Otherwise, a group of I/O errors will be reported if the machine is not down.
1. After the machine is started, press F8 to enter the array management. First, view the logical driver to check the number of physical hard disks that exist and the ports occupied, then careate logical driver selects radius [0] [0 + 1] [1] according to actual needs. I select radius [0] and press F8 to save the disk and exit. Note: run delete logical driver in case of an error and then restart the machine.
2. view the existing File System
Df-k
File System 1 K-block used available % mount point
/Dev/cciss/c0d0p1 98747 14994 78654 17%/boot
/Dev/cciss/c0d0p7 21525300 5074728 15357136 25%/home
/Dev/cciss/c0d1p1 70009904 553120 65900456 1%/old
Based on the results, we recommend that you add a new physical device in linux. The device name above is c0d1. From this we can infer that the new device name is c0d2.
3. verify the accuracy of the new device name
Sfdisk-l/dev/cciss/c0d2
Disk/dev/cciss/c0d2: 17433 cylinders, 255 heads, 32 sectors/track
Sfdisk: ERROR: sector 0 does not have an msdos signature
/Dev/cciss/c0d2: unrecognized partition
4. Partition new devices
Fdisk/dev/cciss/c0d2
Command action
A toggle a bootable flag
B edit bsd disklabel
C toggle the dos compatibility flag
D delete a partition
L list known partition types
M print this menu
N add a new partition
O create a new empty DOS partition table
P print the partition table
Q quit without saving changes
S create a new empty Sun disklabel
T change a partition's system id
U change display/entry units
V verify the partition table
W write table to disk and exit
X extra functionality (experts only)
Command (m for help): n
Command action
E extended
P primary partition (1-4)
P
Partition number (1-4): 1
First cylinder (1-17433, default 1 ):
Using default value 1
Last cylinder or + size or + sizeM or + sizeK (1-17433, default 17433 ):
Using default value 17433
Command (m for help): w
The partition table has been altered!
5. Create a linux File System for the storage device in the new partition: mkfs-t ext3/dev/cciss/c0d2p1
6. overload the file system to the new directory: mount/dev/cciss/c0d2p1 /.
OK. Now your hard disk has been added to the system. You can use the new hard disk. The space is huge.
Note: 1. If the file fails, you can use the umount/dev/cciss/c0d2p1/directory to uninstall it.
2. If the array management program does not find the hard disk and its existing hard disk, the new disk you inserted must be a bad disk. I have encountered all the above cases.