---
title: "KFS 正式部署的时候遇到的问题"
author: "wangwei3"
date: "2011-05-05T11:36:07Z"
tags: []
categories: ["互联网"]
slug: "kfs"
draft: false
lastmod: "2011-05-05T11:36:43Z"
id: 1030004
url: "https://wangwei3.iteye.com/blog/1030004"
---

**一，大硬盘挂载**

1 查看所有的磁盘

```java
sudo fdisk -l |more 
```
 

2 设置磁盘

```java
sudo fdisk /dev/sdb 
```



```java
-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u')
WARNING : DOS

Command (m for help):c <enter>
DOS Compatibility flag is not set (不兼容DOS的模式，如果不用这个模式不能把硬盘设置成1T以上的)

Command (m for help): m <enter>
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 <enter>
Command action
e   extended
p   primary partition (1-4)
p <enter>
Partition number (1-4):
1 <enter>
Command (m for help):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
```


3 格式化硬盘

```java
sudo mke2fs -t ext3 /dev/sdb1
```


4 自动挂载

```java
sudo nano /etc/fstab
```


加入以下信息
/dev/sdb1   /mnt/kfs  ext3  defaults  0  2

注意挂盘的时候一定要挂自己建立的文件目录，这样才可以很随意的换硬盘


**二 修复了Ubuntu 变成了只读文件系统的错误**

发现修改/etc/fstab，提示只读文件系统，:w!也失败。

运行以下语句即可


```java
mount /dev/sda1 / -o rw,remount
```


**三 SSH 配置互通**

只需修改 authorized_keys  的IP 为 192.168.1.*即可达到通配的效果