当前位置: 技术问答>linux和unix
如何在硬盘上创建和安装一个文件系统?
来源: 互联网 发布时间:2015-01-01
本文导语: 如何在硬盘上创建和安装一个文件系统?烦请详细些。非常感激!!软盘上我知道。 (sco open unix 5.0.5) | 用fdisk可看见: +-------------+----------+-----------+---------+---------+---------+ | Partition ...
如何在硬盘上创建和安装一个文件系统?烦请详细些。非常感激!!软盘上我知道。
(sco open unix 5.0.5)
(sco open unix 5.0.5)
|
用fdisk可看见:
+-------------+----------+-----------+---------+---------+---------+
| Partition | Status | Type | Start | End | Size |
+-------------+----------+-----------+---------+---------+---------+
| 1 | Active | UNIX | 1 | 66576 | 66576 |
| 2 | Inactive | UNIX | 66577 | 133152 | 66576 |
| 3 | Inactive | UNIX | 133153 | 199728 | 66576 |
| 4 | Inactive | UNIX | 199729 | 281772 | 82044 |
+-------------+----------+-----------+---------+---------+---------+
我这里分为1--4个区,用FDISK可以创建、删除分区。
SCO_SV:root:/dev>> divvy /dev/hd02 创建data02
+-------------------+------------+--------+---+-------------+------------+
| Name | Type | New FS | # | First Block | Last Block |
+-------------------+------------+--------+---+-------------+------------+
| data02 | HTFS | no | 0 | 0| 2089803|
| | NOT USED | no | 1 | -| -|
| | NOT USED | no | 2 | -| -|
| | NOT USED | no | 3 | -| -|
| | NOT USED | no | 4 | -| -|
| | NOT USED | no | 5 | -| -|
| | NOT USED | no | 6 | -| -|
| hd02 | WHOLE DISK | no | 7 | 0| 2097143|
+-------------------+------------+--------+---+-------------+------------+
2089804 1K blocks for divisions, 7339 1K blocks reserved for the system
要用/dev/data02
mount /dev/data/02 /mnt(或你指定一个目录)
卸掉umount /dev/data02
如果你要开机时自动mount:
在/etc/defalut/filesys中加入:
bdev=/dev/data02 cdev=/dev/rhd02
mountdir=/mnt mount=no fstyp=HTFS
fsck=no fsckflags= rcmount=yes
rcfsck=no mountflags=
+-------------+----------+-----------+---------+---------+---------+
| Partition | Status | Type | Start | End | Size |
+-------------+----------+-----------+---------+---------+---------+
| 1 | Active | UNIX | 1 | 66576 | 66576 |
| 2 | Inactive | UNIX | 66577 | 133152 | 66576 |
| 3 | Inactive | UNIX | 133153 | 199728 | 66576 |
| 4 | Inactive | UNIX | 199729 | 281772 | 82044 |
+-------------+----------+-----------+---------+---------+---------+
我这里分为1--4个区,用FDISK可以创建、删除分区。
SCO_SV:root:/dev>> divvy /dev/hd02 创建data02
+-------------------+------------+--------+---+-------------+------------+
| Name | Type | New FS | # | First Block | Last Block |
+-------------------+------------+--------+---+-------------+------------+
| data02 | HTFS | no | 0 | 0| 2089803|
| | NOT USED | no | 1 | -| -|
| | NOT USED | no | 2 | -| -|
| | NOT USED | no | 3 | -| -|
| | NOT USED | no | 4 | -| -|
| | NOT USED | no | 5 | -| -|
| | NOT USED | no | 6 | -| -|
| hd02 | WHOLE DISK | no | 7 | 0| 2097143|
+-------------------+------------+--------+---+-------------+------------+
2089804 1K blocks for divisions, 7339 1K blocks reserved for the system
要用/dev/data02
mount /dev/data/02 /mnt(或你指定一个目录)
卸掉umount /dev/data02
如果你要开机时自动mount:
在/etc/defalut/filesys中加入:
bdev=/dev/data02 cdev=/dev/rhd02
mountdir=/mnt mount=no fstyp=HTFS
fsck=no fsckflags= rcmount=yes
rcfsck=no mountflags=
|
也可以用管道:
char *cmd = "ps -ef", buf[200];
FILE *ptr;
if ((ptr = popen(cmd, "r")) != NULL)
while (fgets(buf, n, ptr) != NULL)
(void) printf("%s ",buf);
buf读到的:
root 4719 413 0 15:50:43 ? 00:00:00 telnetd
root 4720 4719 0 15:50:44 ttyp15 00:00:00 login -c -p
ssts 13703 1 0 Oct-15 ttyp16 00:00:04 tail -f
。。。。。。。。
有无你要监督的程序,自己编程
char *cmd = "ps -ef", buf[200];
FILE *ptr;
if ((ptr = popen(cmd, "r")) != NULL)
while (fgets(buf, n, ptr) != NULL)
(void) printf("%s ",buf);
buf读到的:
root 4719 413 0 15:50:43 ? 00:00:00 telnetd
root 4720 4719 0 15:50:44 ttyp15 00:00:00 login -c -p
ssts 13703 1 0 Oct-15 ttyp16 00:00:04 tail -f
。。。。。。。。
有无你要监督的程序,自己编程