Use fdisk to partition the remaining disk space

Source: Internet
Author: User

1. Check the partition and find that the hard drive/dev/sdc1 with more than 300 GB only uses more than 200 GB.

[[Email protected] dbbackup] # DF-H

Filesystem size used avail use % mounted on

/Dev/sda2 16g 9.6g 5.1g 66%/

/Dev/sda1 99 m 19 m 76m 20%/boot

Tmpfs 1006 M 22 M 984 M 3%/dev/SHM

/Dev/sdb1 79G 39G 37g 52%/disk1

/Dev/sdc1 197g 173g 15g 93%/disk2

[[Email protected] dbbackup] # fdisk-l

Disk/dev/SDA: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes


Device boot start end blocks ID system

/Dev/sda1*1 13 104391 83 Linux

/Dev/sda2 14 2088 16667437 + 83 Linux

/Dev/sda3 2089 2610 4192965 82 Linux swap/Solaris


Disk/dev/SDB: 85.8 GB, 85899345920 bytes

255 heads, 63 sectors/track, 10443 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes


Device boot start end blocks ID system

/Dev/sdb1 1 10443 83883366 83 Linux


Disk/dev/SDC: 322.1 GB, 322122547200 bytes

255 heads, 63 sectors/track, 39162 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes


Device boot start end blocks ID system

/Dev/sdc1 126108209712478 + 83 Linux

2. Partition

[[Email protected] dbbackup] # fdisk/dev/SDC

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

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)


Command (M for help ):N

Command action

E extended

P primary partition (1-4)

P

Partition Number (1-4 ):2

First cylinder (26109-39162, default 26109 ):Press enter (you will find that this is the value of sdc1 end sector + 1.)

Using default value 26109

Last cylinder or + size or + sizem or + sizek (26109-39162, default 39162 ):Enter

Using default value 39162


Command (M for help ):W

The partition table has been altered!


Calling IOCTL () to re-read partition table.


Warning: re-reading the Partition Table failed with error 16: device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[[Email protected] dbbackup] #Partprobe

[[Email protected] dbbackup] #Fdisk-l


Disk/dev/SDA: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes


Device boot start end blocks ID system

/Dev/sda1*1 13 104391 83 Linux

/Dev/sda2 14 2088 16667437 + 83 Linux

/Dev/sda3 2089 2610 4192965 82 Linux swap/Solaris


Disk/dev/SDB: 85.8 GB, 85899345920 bytes

255 heads, 63 sectors/track, 10443 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes


Device boot start end blocks ID system

/Dev/sdb1 1 10443 83883366 83 Linux


Disk/dev/SDC: 322.1 GB, 322122547200 bytes

255 heads, 63 sectors/track, 39162 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes


Device boot start end blocks ID system

/Dev/sdc1 1 26108 209712478 + 83 Linux

/Dev/sdc2 26109 39162 104856255 83 Linux


[[Email protected] dbbackup] #Mkfs. ext3/dev/sdc2

Mke2fs 1.39 (29-may-2006)

Filesystem label =

OS type: Linux

Block size = 4096 (log = 2)

Fragment size = 4096 (log = 2)

13107200 inodes, 26214063 Blocks

1310703 blocks (5.00%) reserved for the Super User

First data block = 0

Maximum filesystem blocks = 4294967296

800 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768,983 04, 163840,229 376, 294912,819 200, 884736,160 5632, 2654208,

4096000,796 2624, 11239424,204 23887872


Writing inode tables: Done

Creating Journal (32768 blocks): Done

Writing superblocks and filesystem accounting information: Done


This filesystem will be automatically checked every 38 mounts or

180 days, whichever comes first. Use tune2fs-C or-I to override.


[[Email protected] dbbackup] # mkdir/disk3

[[Email protected] dbbackup] # Mount/dev/sdc2/disk3


Add to/etc/fstab

Label = // ext3 defaults 1 1

Label =/boot ext3 defaults 1 2

Tmpfs/dev/SHM tmpfs defaults 0 0

Devpts/dev/PTS devpts gid = 5, mode = 620 0 0

Sysfs/sys sysfs defaults 0 0

Proc/proc defaults 0 0

Label = SWAP-sda3 swap defaults 0 0

/Dev/sdb1/disk1 ext3 defaults 1 3

/Dev/sdc1/disk2 ext3 defaults 1 4

/Dev/sdc2/disk3 ext3 defaults 1 5


This article is from the "Deven blog", please be sure to keep this source http://wwdhks.blog.51cto.com/839773/1616440

Use fdisk to partition the remaining disk space

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.