分类: LINUX
2006-06-02 09:36:49
Linux磁盘管理
1:df命令
mark:/#df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 37879048 194140 35760724 1% /
tmpfs 254432 0 254432 0% /dev/shm
/dev/hda1 90297 10510 74970 13% /boot
2:挂载文件系统
mark:/#mount -t vfat /dev/hdc1 /win1
mark:/#mount -t vfat /dev/hdc2 /win2
mark:/#mount -t ext2 /dev/hdc3 /lin1
mark:/#mount -t ext3 /dev/hdc4 /lin2
如果挂载需要查看中文:
mount -t vfat -o utf8 /dev/hdc1 /win1
mount -t vfat -o codepage=936,iocharset=gb2312,umask=0 /dev/hdc2 /win2
3:文件系统的格式
ext2, ext3, minix, vfat, msdos, cramfs......
4:分区 mark:/#fdisk /dev/hdc
The number of cylinders for this disk is set to 19929
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 version of LILO)
2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):m
介绍几种常用的命令:
P命令:显示分区信息
d命令:删除分区
n命令:新建分区
w命令:写入修改并退出
q命令:放弃修改并退出
5:格式化
mkfs:加参数指定 分区格式
mkfs.ext2:格式化成ext2 等同于mke2fs
mkfs.ext3: 格式化成ext3
mkfs.cramfs: 格式化成cramfs
mkfs.msdos: 格式化成msdos 等同于mkdosfs
mkfs.minix: 格式化成minix
mkfs.vfat: 格式化成vfat
mkswap: 格式化成虚拟内存
6: 开机自动挂载分区
在/etc/fstab中写入需要挂载的分区
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
/dev/hda3 / ext3 defaults,errors=remount-ro 0 1
/dev/hda1 /boot ext3 defaults 0 2
/dev/hdc1 /win1 vfat defaults 0 2
/dev/hdc2 /win2 vfat defaults 0 2
/dev/hdc3 /win3 vfat defaults 0 2
/dev/hdc4 /win4 vfat defaults 0 2
/dev/hda2 none swap sw 0 0
/dev/hdd /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
|