Introduces how to add a new hard disk in Linux.

Source: Internet
Author: User
Article Title: describes how to add a new 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.

How to add a hard disk to the System

[Root @ gyhredhat root] # fdisk

Usage: fdisk [-l] [-B SSZ] [-u] device

E. g.: fdisk/dev/hda (for the first IDE disk)

Or: fdisk/dev/sdc (for the third SCSI disk)

Or: fdisk/dev/eda (for the first PS/2 ESDI drive)

Or: fdisk/dev/rd/c0d0 or: fdisk/dev/ida/c0d0 (for RAID devices)

......

[Root @ gyhredhat root] # df-k

File System 1 K-block used available % mount point

/Dev/sda3 3723848 705968 2828716 20%/

/Dev/sda1 101089 9274 86596 10%/boot

None 14520 0 14520 0%/dev/shm

For the new hard disk partition, 1 GB is selected from the 4G hard disk as the new partition. For/home

[Root @ gyhredhat root] # fdisk/dev/hda

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

Until you decide to write them. After that, of course, the previous

Content won't be recoverable.

The number of cylinders for this disk is set to 8322.

There is nothing wrong with that, but this is larger than 1024,

And coshould in certain setups cause problems:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(E.g., dos fdisk, OS/2 FDISK)

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite)

Command (m for help): p

Disk/dev/hda: 4294 MB, 4294967296 bytes

16 heads, 63 sectors/track, 8322 cylinders

Units = cylinders of 1008*512 = 516096 bytes

Device Boot Start End Blocks Id System

Command (m for help): m

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-8322, default 1 ):

Using default value 1

Last cylinder or + size or + sizeM or + sizeK (1-8322, default 8322): 1000G

Command (m for help): p

Disk/dev/hda: 4294 MB, 4294967296 bytes

16 heads, 63 sectors/track, 8322 cylinders

Units = cylinders of 1008*512 = 516096 bytes

Device Boot Start End Blocks Id System

/Dev/hda1 1 1000 503968 + 83 Linux

Command (m for help): w

The partition table has been altered!

Calling ioctl () to re-read partition table.

Syncing disks.

[1] [2] [3] [4] Next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.