1. Add disk to view disk status
The code is as follows |
Copy Code |
[ROOT@DB1/]# Fdisk-l disk/dev/sda:10.7 GB, 10737418240 bytes 255 heads, Sectors/track, 1305 cylinders Units = Cylinders of 16065 * 8225280 bytes Device Boot Start End Blocks Id System /DEV/SDA1 * 151 1305 9277537+ Linux /dev/sda2 1 1204843+ Linux swap Partition table entries are in-disk order disk/dev/sdb:5368 MB, 5368709120 bytes 255 heads, Sectors/track, 652 cylinders Units = Cylinders of 16065 * 8225280 bytes Device Boot Start End Blocks Id System |
From the results of the query, a/DEV/SDB disk
2. Use Fdisk to partition the/DEV/SDB
The code is as follows |
Copy Code |
[ROOT@DB1/]# Fdisk/dev/sdb Command (M for help): N Command Action E Extended P primary partition (1-4) P Partition number (1-4): 1 The cylinder (1-652, default 1): Using Default value 1 Last cylinder or +size or +sizem or +sizek (1-652, default 652): Using Default value 652 Command (M for help): W The partition table has been altered! Calling IOCTL () to re-read partition table. Syncing disks. |
Look at the partition again, come out with a/dev/sdb1 area, this 1 is what we specified earlier, if we specify 2, it becomes sdb2.
The code is as follows |
Copy Code |
[ROOT@DB1/]# Fdisk-l disk/dev/sda:10.7 GB, 10737418240 bytes 255 heads, Sectors/track, 1305 cylinders Units = Cylinders of 16065 * 8225280 bytes Device Boot Start End Blocks Id System /DEV/SDA1 * 151 1305 9277537+ Linux /dev/sda2 1 1204843+ Linux swap Partition table entries are in-disk order disk/dev/sdb:5368 MB, 5368709120 bytes 255 heads, Sectors/track, 652 cylinders Units = Cylinders of 16065 * 8225280 bytes Device Boot Start End Blocks Id System /DEV/SDB1 1 652 5237158+ Linux [ROOT@DB1/]# |
3. Format/DEV/SDB1 partition
The code is as follows |
Copy Code |
[ROOT@DB1/]# mkfs-t EXT3/DEV/SDB1 MKE2FS 1.35 (28-feb-2004) FileSystem label= OS Type:linux Block size=4096 (log=2) Fragment size=4096 (log=2) 655360 inodes, 1309289 blocks 65464 blocks (5.00%) reserved for the Super user The Data block=0 Maximum filesystem blocks=1342177280 Block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 Writing Inode Tables:done Creating journal (8192 blocks): Done Writing superblocks and filesystem accounting Information:done This filesystem'll be automatically checked every mounts or 180 days, whichever comes. Use Tune2fs-c or-i to override. |
4. Create the table of contents and hang the/DEV/SDB1 to the directory
The code is as follows |
Copy Code |
[ROOT@DB1/]# ls Backup dev initrd media opt sbin sys usr Bin etc Lib Misc proc SELinux tftpboot var Boot home lost+found mnt root SRV tmp [ROOT@DB1/]# mkdir/u01 [ROOT@DB1/]# ls Backup dev initrd media opt sbin sys u01 Bin etc Lib misc proc SELinux tftpboot usr Boot home lost+found mnt root SRV tmp var [ROOT@DB1/]# mount/dev/sdb1/u01 |
5. Verify that the mount is successful
The code is as follows |
Copy Code |
[ROOT@DB1/]# Df-k FileSystem 1k-blocks Used Available use% mounted on /DEV/SDA1 9131772 7066884 1601012 82%/ None 454256 0 454256 0%/dev/shm /DEV/SDB1 5154852 43040 4849956 1%/backup |
6. Set up automatic mount
The code is as follows |
Copy Code |
[ROOT@DB1/]# Vi/etc/fstab # this, edited by Fstab-sync-see ' Mans Fstab-sync ' for details label=//ext3 Defaults 1 1 None/dev/pts devpts gid=5,mode=620 0 0 NONE/DEV/SHM TMPFS Defaults 0 0 NONE/PROC proc Defaults 0 0 None/sys Sysfs Defaults 0 0 Label=swap-sda2 Swap Defaults 0 0 /dev/sdb1/u01 ext3 defaults 0 0 /dev/hdc/media/cdrom Auto Pamconsole,exec,noauto,m Anaged 0 0 /dev/fd0/media/floppy Auto Pamconsole,exec,noauto,m Anaged 0 0 |