日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux server添加硬盘,新增硬盘扩充linux ftp server空间

發(fā)布時間:2023/12/19 linux 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux server添加硬盘,新增硬盘扩充linux ftp server空间 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

【背景】?原/ftp分區(qū)空間不足

【需求】新增一顆硬盤,將/ftp分區(qū)掛載點指向新硬盤.

【操作步驟】

1. 新增硬盤,并分區(qū)\格式化;

[root@bjftp01?~]#?fdisk?-lDisk?/dev/sda:?160.0?GB,?160041885696?bytes255?heads,?63?sectors/track,?19457?cylindersUnits?=?cylinders?of?16065?*?512?=?8225280?bytes???Device?Boot??????Start?????????End??????Blocks???Id??System/dev/sda1???*???????????1????????2550????20482843+??83??Linux/dev/sda2????????????2551????????2805?????2048287+??82??Linux?swap?/?Solaris/dev/sda3????????????2806???????19457???133757190???83??LinuxDisk?/dev/sdb:?500.1?GB,?500107862016?bytes255?heads,?63?sectors/track,?60801?cylindersUnits?=?cylinders?of?16065?*?512?=?8225280?bytes???Device?Boot??????Start?????????End??????Blocks???Id??System/dev/sdb1???????????????1???????60801???488384001???83??Linux

新硬盤分區(qū):[root@bjftp01?~]# fdisk /dev/sdb

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

新增一個主分區(qū):/dev/sdb1

完成后按W保存退出

新分區(qū)格式化:

mkfs.ext3 /dev/sdb1

掛載測試:

mount /dev/sdb1 /mnt/ftpnew/

2.同步原/ftp資料到新分區(qū)

rsync -avp /ftp/?/mnt/ftpnew/

3.修改/etc/fstab

LABEL=/ ? ? ? ? ? ? ? ? ?/ ? ? ? ? ? ? ? ? ? ? ?ext3 ? defaults ? ? ? 1 1

#LABEL=/ ? ? ? ? ? ? ? ? /ftp ? ? ? ? ? ? ? ? ? ext3 ? ?defaults ? ? ?1 2

/dev/sda3 ? ? ? ? ? ? ? ?/ftpbk ? ? ? ? ? ? ? ? ext3 ? ?defaults ? ? ?1 2

/dev/sdb1 ? ? ? ? ? ? ? /ftp ? ? ? ? ? ? ? ? ? ?ext3 ? ?defaults ? ? ? 1 2

tmpfs ? ? ? ? ? ? ? ? ? /dev/shm ? ? ? ? ? ? ? ?tmpfs ? defaults ? ? ? ?0 0

devpts ? ? ? ? ? ? ? ? ?/dev/pts ? ? ? ? ? ? ? ?devpts ?gid=5,mode=620 ?0 0

sysfs ? ? ? ? ? ? ? ? ? /sys ? ? ? ? ? ? ? ? ? ?sysfs ? defaults ? ? ? ?0 0

proc ? ? ? ? ? ? ? ? ? ?/proc ? ? ? ? ? ? ? ? ? proc ? ?defaults ? ? ? ?0 0

LABEL=SWAP-sda2 ? ? ? ? swap ? ? ? ? ? ? ? ? ? ?swap ? ?defaults ? ? ? ?0 0

修改完成需重啟系統(tǒng)才可以生效.

如修改有問題會無法啟動系統(tǒng),進(jìn)入到single模式檢查修改配置即可.

注意:single模式下系統(tǒng)為只讀,無法直接修改/etc/fstab文件,需先執(zhí)行如下命令:

mount -o remount,rw /?????? 逗號前無空格,一定要有/這個

重新掛載為 讀寫模式。

再 vi /etc/fstab 發(fā)現(xiàn)已經(jīng)可以修改了,修改完畢,重啟,正常。

4.系統(tǒng)啟動,驗證新分區(qū)和舊分區(qū)的資料.

[root@bjftp01?~]#?df?-hFilesystem????????????Size??Used?Avail?Use%?Mounted?on/dev/sda1??????????????19G???13G??5.7G??69%?//dev/sda3?????????????124G??124G?????0?100%?/ftpbk/dev/sdb1?????????????459G??125G??312G??29%?/ftptmpfs?????????????????377M?????0??377M???0%?/dev/shmnone??????????????????377M??104K??377M???1%?/var/lib/xenstored

[root@bjftp01?ftp]#?lltotal?60drwxr-xr-x??3?root?root??4096?May?14??2014?Software

[root@bjftp01?ftpbk]#?lltotal?44drwxr-xr-x??3?root?root??4096?May?14??2014?Software

5.都沒問題,finished!

總結(jié)

以上是生活随笔為你收集整理的linux server添加硬盘,新增硬盘扩充linux ftp server空间的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。