導航:首頁 > 編程系統 > linux伺服器加硬碟

linux伺服器加硬碟

發布時間:2021-12-03 03:09:13

1. linux伺服器如何掛載硬碟

一、檢測硬碟能否被識別
# fdisk -l
查找新硬碟信息,類似如下文本:
Disk /dev/sdb: 36.7 GB, 36748945408 bytes
二、掛載硬碟
1、在本地硬碟中臨時創建一個目錄
#mkdir /opt/data/tmp1
2、掛載第二塊硬碟中的一個分區/dev/sdb1到tmp1
#mount /dev/sdb1 /opt/data/tmp1
3、查看是否被掛載
# df -h
查看一下是否有類似如下文本
/dev/sdb1 3.9G 1.4G 2.3G 38% /opt/tmp/tmp1
三、卸載硬碟
#umount /dev/sdb1
注意:
1、以上操作必須為root用戶
2、硬碟插上去後需要重起伺服器

2. linux系統如何增加硬碟並調整分區

linux嘛,可以掛載。
硬碟復是物理設備,制你不買新的,或者不騰出其他空閑空間,沒法加對吧。

取一個其他空閑的分區,或者一塊新的硬碟。
把這塊新的硬碟的某個分區直接掛載到 oracle 的分區就可以啊
但是這樣會覆蓋原來的分區。
所以最好先把原來的資料備份到新的硬碟分區,再把這個分區掛載到 oracle目錄就可以
或者在原oracle下建個文件夾,把新分區掛載到這個文件夾,但是這樣可能會不太方便

3. linux下,如何掛載一塊硬碟

Linux 將一塊硬碟進行掛載到任意目錄下的方法如下:

掛載目錄是任意的,由你自己內決定。

1、首先容先在虛擬機上添加一塊硬碟,打開虛擬機收輸入fdisk -l 將,系統中所有的分區都列出來;

4. linux系統伺服器怎麼加硬碟

我們可以這個在系統載入,難度不大。但是此過程大概要20分鍾左右,因為需要同時伺服器服務要停止。

在 Linux 下設備文件放在 /dev 目錄下。

IDE 硬碟 第一塊 /dev/hda 、第二塊硬碟 /dev/hdb 、第三塊 /dev/hdc.

SCSI 硬碟 第一塊 /dev/sda 、第二塊硬碟 /dev/sdb 、第三塊 /dev/sdc

Hp raid or cpq array ( 這一點要注意 ).

第一個 logic driver /dev/cciss/c0d0

第二個 logic driver /dev/cciss/c0d1

以添加 SCSI 硬碟為例:

[root@linux /]# fdisk /dev/sdb 用 fdisk 工具來創建新的分區

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.

The number of cylinders for this disk is set to 17366.

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 versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

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-17366, default 1): 1

Last cylinder or +size or +sizeM or +sizeK (1-17366, default 17366): +10000M 選擇分區大小

Command (m for help): w 保存退出

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@linux /]# mkfs -t ext3 /dev/sdb1 將我創建的第一個分區 sdb1 格式化

mke2fs 1.27 ( 8-Mar-2002 )

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

1281696 inodes, 2560252 blocks

128012 blocks (5.00%) reserved for the super user

First data block=0

79 block groups

32768 blocks per group, 32768 fragments per group

16224 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

[root@linux /]# mkdir /new 創建一個根目錄

[root@linux /]# mount /dev/sdb1 /new 將 sdb1 分區 mount to /new

[root@linux /]# fdisk -l 查看分區信息

Disk /dev/sda: 64 heads, 32 sectors, 17366 cylinders

Units = cylinders of 2048 * 512 bytes

Device Boot Start End Blocks Id System

/dev/sda1 * 1 100 102384 83 Linux

/dev/sda2 101 12100 12288000 83 Linux

/dev/sda3 12101 16100 4096000 83 Linux

/dev/sda4 16101 17366 1296384 f Win95 Ext"d (LBA)

/dev/sda5 16101 16866 784368 82 Linux swap

/dev/sda6 16867 17366 511984 83 Linux

Disk /dev/sdb: 64 heads, 32 sectors, 17366 cylinders

Units = cylinders of 2048 * 512 bytes

Device Boot Start End Blocks Id System

/dev/sdb1 1 10001 10241008 83 Linux

[root@linux /]# df 查看分區信息

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sda2 12095032 2919684 8560948 26% /

/dev/sda1 99134 17861 76154 19% /boot

/dev/sda3 4031680 32968 3793912 1% /home

none 127688 0 127688 0% /dev/shm

/dev/sda6 495828 153957 316272 33% /var

/dev/sdb1 10080092 32828 9535216 1% /new

[root@linux /]#

5. 如何在Linux伺服器中添加新的硬碟1

伺服器啟動時,會有一個提示,讓你輸入某個鍵(一般是ctrl+A),進入raid卡配置程序,這一般都是圖形界面的,在raid管理界面中能夠看到raid信息,也可以修改raid配置。
加1塊單獨硬碟的話,把伺服器關掉,插入硬碟,開機,進入raid界面,後面的設置步驟很簡單的,你只要別去動原先那兩塊硬碟的raid就行了。加2塊再作一個raid1陣列也差不多。
但如果你想把新的硬碟加到原有的陣列中,硬碟數量何容量得符合要求。這個比較麻煩,建議你還是把新的硬碟作成新的陣列吧。

推薦你看一本書《linux就該這么學》書中內容非常豐富,LINUX基本問題都可以在書中解決。望採納!

6. HP伺服器linux 操作系統如何添加硬碟

以前的g5
用的是p400的陣列卡
現在的g6是剛出來的p410陣列卡
5.0的盤還沒有包含這個驅動
所以必須下載驅動載入安裝!才行!

7. 如何給linux添加新硬碟

fdisk -l ## 這里是查看目前系統上有幾塊硬碟
Disk /dev/sda: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 255 2048256 83 Linux
/dev/sda2 256 1530 10241437+ 83 Linux
/dev/sda3 4296 4425 1044225 82 Linux swap
/dev/sda4 1531 4295 22209862+ f Win95 Ext'd (LBA)
/dev/sda5 1531 2805 10241406 83 Linux
/dev/sda6 2806 4295 11968393+ 83 Linux

Partition table entries are not in disk order

Disk /dev/sdb: 36.7 GB, 36703918080 bytes ## 這里發現/dev/sdb,容量36.7G,且未被分區
255 heads, 63 sectors/track, 4462 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
在伺服器上把硬碟接好,啟動linux,以root登陸。

比如我新加一塊SCSI硬碟,需要將其分成三個區:

#fdisk /dev/sdb
進入fdisk模式:
Command (m for help):p //查看新硬碟的分區
Command (m for help):n //創建新分區

可以用m命令來看fdisk命令的內部命令;n命令創建一個新分區;d命令刪除一個存在的分區;p命令顯示分區列表;t命令修改分區的類型ID號;l命令顯示分區ID號的列表;a命令指定啟動分區;w命令是將對分區表的修改存檔讓它發生作用。

Command action
e extended //輸入e為創建擴展分區
p primary partition (1-4) //輸入p為創建主分區,這里我們選擇p

Partion number(1-4):1 //第一個擴展分區,按你需求可以最多分4個主分區
First Cylinder(1-1014,default 1): 1 //第一個主分區起始的磁碟塊數
Last cylindet or +siza or +sizeM or +sizeK: +1024MB //可以是以MB為單位的數字或者以

磁碟塊數,這里我們輸入+1024MB表示分區大小為1G。

這樣我們就創建完一個分區,如果要創建更多分區可以照上面的步驟繼續創建。

創建完後用w保存分區。

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

這樣就分區完,我們還要進行格式化

#mkfs -t ext3 -c /dev/sdb1 //如果有多個分區,則分區修改為sdb2這樣

格式化完後我們需要進行掛載分區,

#mkdir www //創建/www目錄,我們將把新的分區掛到www下
#mount /dev/sdb1 /www //將/dev/sdb1掛載到/www
# df //用df命令進行查看
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 3771316 1388956 2190788 39% /
/dev/sda1 101089 9463 86407 10% /boot
none 62988 0 62988 0% /dev/shm
/dev/sdb1 485906 8239 452580 2% /www //看到了,這就是我們剛

才新掛載的分區

到這里我們工作已接近尾聲了,不過我們如果這樣就結束的話,我們每次重新啟動伺服器後都要

進行手工掛載,這樣很麻煩,我們需要修改/etc/fstab文件來進行自動掛載。

#vi /etc/fstab

在文件的末尾填加如下內容:

/dev/sdb1 /www ext3 defaults 1 2

如有多個分區可修改sdb1和/www,修改完後保存,重起伺服器。

到此我們添加新硬碟的工作結束了。

8. Linux伺服器新加入一塊硬碟,想把新加入的磁碟空間合並到根分區下,怎麼操作

伺服器是有做raid的嗎,如果有做raid的,是不能添加的,因為raid信息會改變,磁碟裡面的信息就會沒的。

閱讀全文

與linux伺服器加硬碟相關的資料

熱點內容
win10傳文件預先佔用空間 瀏覽:527
java多線程監聽 瀏覽:882
win10殺手5打不開 瀏覽:10
數據線016BC是什麼意思 瀏覽:48
台州百泰網路技術有限公司儲備主管 瀏覽:614
蘋果也微信語音有風聲 瀏覽:378
搞笑男同電影最近 瀏覽:637
javalistmap 瀏覽:174
藍星小葉主角叫葉楓 瀏覽:334
win10怎麼把文件改成vbs文件路徑 瀏覽:923
南城免費的進出口數據平台哪個好 瀏覽:950
周星馳電影下載文件 瀏覽:600
qq頭像掛件絕版代碼 瀏覽:604
帶點黃色的都市小說 瀏覽:725
java配置文件參數 瀏覽:257
買足球鞋用什麼網站 瀏覽:107
粵語電影迅雷下載 瀏覽:786
怎麼導入文件夾進u盤 瀏覽:732
stm8s103源程序 瀏覽:441
我能復制天賦葉天小說免費閱讀 瀏覽:49

友情鏈接