分类: LINUX
2010-12-15 16:31:44
[root@cent initrd]# fdisk /dev/sda
The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from
other
(e.g., DOS FDISK, OS/2 FDISK)
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): p
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 25 200781 83 Linux
/dev/sda2 26 1682 13309852+ 83 Linux
/dev/sda3 1683 2064 3068415 83 Linux
/dev/sda4 2065 2610 4385745 5 Extended
/dev/sda5 2065 2102 305203+ 82 Linux swap / Solaris
/dev/sda6 2103 2107 40131 83 Linux
Command (m for help): d
Partition number (1-6): 6
Command (m for help): p
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 25 200781 83 Linux
/dev/sda2 26 1682 13309852+ 83 Linux
/dev/sda3 1683 2064 3068415 83 Linux
/dev/sda4 2065 2610 4385745 5 Extended
/dev/sda5 2065 2102 305203+ 82 Linux swap / Solaris
Command (m for help): n
First cylinder (2103-2610, default 2103):
Using default value 2103
Last cylinder or +size or +sizeM or +sizeK
(2103-2610, default 2610): +
Command (m for help): p
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 25 200781 83 Linux
/dev/sda2 26 1682 13309852+ 83 Linux
/dev/sda3 1683 2064 3068415 83 Linux
/dev/sda4 2065 2610 4385745 5 Extended
/dev/sda5 2065 2102 305203+ 82 Linux swap / Solaris
/dev/sda6 2103 2107 40131 83 Linux
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.
[root@cent initrd]# partprobe
[root@cent initrd]# mkfs -t ext3 /dev/sda6
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
10040 inodes, 40128 blocks
2006 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=41156608
5 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
8193, 24577
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@cent initrd]# fsck -C -t ext3 /dev/sda6
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/sda6: clean, 11/10040 files, 5868/40128 blocks
6.挂载分区
[root@cent initrd]# mount /dev/sda6 /mnt
[root@cent initrd]# df -m
Filesystem
/dev/sda2 12591 3679 8263 31% /
/dev/sda3 2903 239 2515 9% /home
/dev/sda1 190 12 169 7% /boot
tmpfs 506 0 506 0% /dev/shm
/dev/sda6 38 5 32 13% /mnt
chinaunix网友2010-12-16 14:48:03
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com