为什么80%的码农都做不了架构师?>>>
空间不足
[root@Alicia ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
4443816 4337616 0 100% /
/dev/sda1 101086 12075 83792 13% /boot
tmpfs 127772 0 127772 0% /dev/shm
看哪里可以删
[root@Alicia ~]# du -h --max-depth=1 /
280K /home
6.3M /boot
20K /data
78M /lib
124M /etc
0 /proc
8.0K /srv
8.0K /mnt
151M /var
29M /sbin
0 /net
0 /misc
7.2M /bin
0 /sys
8.0K /opt
132K /dev
4.0K /uploadFile
342M /root
140K /tmp
8.0K /media
3.7G /usr
12K /headImg
8.0K /selinux
16K /lost+found
4.4G /
查看硬盘
[root@Alicia ~]# fdisk -l
Disk /dev/sda: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 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 652 5132767+ 8e Linux LVM
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table sdb盘没用到
[root@Alicia ~]# fdisk /dev/sdb 对sdb盘进行操作
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.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p 查看sdb盘分区情况
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 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-261, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261
Command (m for help): p
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 261 2096451 83 Linux
Command (m for help): w 写进文件
The partition table has been altered!
格式化
[root@Alicia ~]# mkfs -t ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
262144 inodes, 524112 blocks
26205 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (8192 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@Alicia ~]# mkdir /data
[root@Alicia ~]# mount /dev/sdb1 /data
[root@Alicia ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
4.3G 4.2G 0 100% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 125M 0 125M 0% /dev/shm
/dev/sdb1 2.0G 36M 1.9G 2% /data
[root@Alicia ~]# reboot
自动挂载
[root@Alicia ~]# e2label /dev/sdb1
[root@Alicia ~]# e2label /dev/sdb1 data
[root@Alicia ~]# e2label /dev/sdb1
data
[root@Alicia ~]# vi /etc/fstab
1 /dev/VolGroup00/LogVol00 / ext3 default
s 1 1
2 LABEL=/boot /boot ext3 defaults
1 2
3 tmpfs /dev/shm tmpfs defaults
0 0
4 devpts /dev/pts devpts gid=5,mo
de=620 0 0
5 sysfs /sys sysfs defaults
0 0
6 proc /proc proc defaults
0 0
7 /dev/VolGroup00/LogVol01 swap swap default
s 0 0
8 LABEL=data /data ext3 defaults
1 1
[root@Alicia ~]# mount -a
[root@Alicia ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
4443816 4337720 0 100% /
/dev/sda1 101086 12075 83792 13% /boot
tmpfs 127772 0 127772 0% /dev/shm
/dev/sdb1 2063504 35880 1922804 2% /data
[root@Alicia ~]# reboot