日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
如何使用LinuxMount掛載遠(yuǎn)程磁盤(linuxmount遠(yuǎn)程磁盤)

Linux Mount 是一種非常常用的命令,它是用來將磁盤掛載到操作系統(tǒng)上的。在使用 Linux Mount 掛載本地磁盤時(shí)非常簡(jiǎn)單,但是在掛載遠(yuǎn)程磁盤時(shí)可能會(huì)稍微有些困難。本篇文章將會(huì)幫助您了解如何正確地使用 Linux Mount 掛載遠(yuǎn)程磁盤。

一、遠(yuǎn)程掛載

在開始之前,您需要了解什么是遠(yuǎn)程掛載。一般情況下,我們都是將磁盤直接掛載到本地操作系統(tǒng)上,但是如果您的磁盤在另一臺(tái)機(jī)器上,您可以使用遠(yuǎn)程掛載的方式將其掛載到本地上。遠(yuǎn)程掛載可以讓我們?cè)趦膳_(tái)機(jī)器之間分享文件,而且具有很高的靈活性。

二、配置 SSH

在進(jìn)行遠(yuǎn)程掛載之前,您需要配置好 SSH。這是因?yàn)樵趻燧d遠(yuǎn)程磁盤時(shí),Linux 需要使用 SSH 協(xié)議進(jìn)行通信。如果您還沒有安裝 SSH,可以通過以下命令安裝:

“`shell

sudo apt-get install openssh-server

“`

如果您已經(jīng)安裝了 SSH,則需要確保它已經(jīng)啟動(dòng)。您可以用以下命令檢查 SSH 是否正在運(yùn)行:

“`shell

sudo systemctl status ssh

“`

如果 SSH 未啟動(dòng),則可以使用以下命令啟動(dòng)它:

“`shell

sudo systemctl start ssh

“`

三、安裝 sshfs

安裝 SSH 后,您需要在本地系統(tǒng)上安裝 SSHFS。SSHFS 是一個(gè)應(yīng)用程序,它可以將 SSH 文件系統(tǒng)掛載到本地系統(tǒng)上。您可以使用以下命令在 Ubuntu 系統(tǒng)上安裝 SSHFS:

“`shell

sudo apt-get install sshfs

“`

四、創(chuàng)建掛載點(diǎn)

在進(jìn)行遠(yuǎn)程掛載之前,您需要在本地系統(tǒng)上創(chuàng)建一個(gè)掛載點(diǎn)。掛載點(diǎn)是本地系統(tǒng)上一個(gè)文件夾,它將用來存儲(chǔ)遠(yuǎn)程磁盤上的文件。您可以使用以下命令創(chuàng)建一個(gè)掛載點(diǎn):

“`shell

sudo mkdir /mnt/remote-disk

“`

五、掛載遠(yuǎn)程磁盤

現(xiàn)在,您已經(jīng)完成了所有的前置工作。接下來,您需要將遠(yuǎn)程磁盤掛載到本地系統(tǒng)上:

“`shell

sshfs @: /mnt/remote-disk

“`

其中, 是您登錄遠(yuǎn)程系統(tǒng)時(shí)使用的用戶名, 是遠(yuǎn)程系統(tǒng)的 IP 地址, 是遠(yuǎn)程系統(tǒng)上需要掛載的文件夾路徑,/mnt/remote-disk 是您在本地系統(tǒng)上創(chuàng)建的掛載點(diǎn)。

例如,如果我們要將 192.168.1.100 機(jī)器上的 /home/user/Documents 文件夾掛載到本地的 /mnt/remote-disk 文件夾上。那么,我們可以使用以下命令進(jìn)行掛載:

“`shell

sshfs user@192.168.1.100:/home/user/Documents /mnt/remote-disk

“`

現(xiàn)在,您已經(jīng)成功掛載了遠(yuǎn)程磁盤。您可以通過訪問 /mnt/remote-disk 文件夾,查看遠(yuǎn)程文件夾中的文件了。當(dāng)您完成時(shí)間,可以使用以下命令取消掛載:

“`shell

fusermount -u /mnt/remote-disk

“`

六、自動(dòng)掛載

如果您反復(fù)需要掛載磁盤到本地系統(tǒng)上,那么每次都要手動(dòng)進(jìn)行這些操作肯定很麻煩。幸運(yùn)的是,您可以使用一些技巧來自動(dòng)掛載遠(yuǎn)程磁盤。例如,您可以將掛載命令添加到 /etc/fstab 文件中,以便系統(tǒng)啟動(dòng)時(shí)自動(dòng)掛載。

“`shell

user@192.168.1.100:/home/user/Documents /mnt/remote-disk fuse.sshfs defaults,user,IdentityFile=/path/to/ssh/key 0 0

“`

請(qǐng)注意,您需要將設(shè)置您自己的 SSH 秘鑰。

七、

相關(guān)問題拓展閱讀:

  • linux下如何掛載硬盤?
  • LINUX里用mount怎么掛在硬盤,比如E盤~mount /media/然后呢?!

linux下如何掛載硬盤?

1.插入新硬盤,啟動(dòng)Linux服務(wù)器,使用fdisk -l 查看硬盤

#fdisk -l

Disk /dev/sdb: 1000.2 GB, bytes

2.格式化硬盤

#mkfs -t ext4 /dev/sdb

3.掛載硬盤

#mount 硬盤地址 要掛載的地址

#mount /dev/sdb /media/imgs

4.實(shí)現(xiàn)系統(tǒng)重啟后自動(dòng)掛載該分區(qū)

#vi /etc/fstab

在最后一行添加

/dev/sdb /media/imgs ext4 defaults 1 2

一、添加磁盤

添加加乎帶悉新硬盤重啟服務(wù)器

添加完之后就可以重啟機(jī)器了,如果你機(jī)器是開啟的,進(jìn)入系統(tǒng)并不能看見你剛添加的那塊磁盤,只有等系統(tǒng)重啟,重新加載之后才會(huì)顯示安裝的那塊磁盤

二、進(jìn)入系統(tǒng)

使用root用戶進(jìn)入系統(tǒng)

三、 查看硬盤信息

# fdisk -l   //磁盤命令

Disk /dev/sda: 21.5 GB,bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of* 512 =bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000c4cb5

Device Boot      StartEnd      Blocks   Id  System

/dev/sda1   *行運(yùn) 83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda  8e  Linux LVM

Disk /dev/sdb: 21.5 GB,bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of* 512 =bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0xd0f5c869

Device Boot      StartEnd      Blocks   Id  System

/dev/sdb+  83  Linux

Disk /dev/sdc: 21.5 GB,bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of* 512 =bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x

可以看到這臺(tái)機(jī)器加載了三個(gè)磁盤sda、sdb、sdc 

其中sda是初始磁盤,sdb已經(jīng)初始化且經(jīng)過使用,sdc是剛剛加載的,未格式化的新磁盤

四、創(chuàng)建新硬盤分區(qū)

# fdisk /dev/sdc #進(jìn)入磁歲乎盤

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x45a3cadb.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to

switch off the mode (command ‘c’) and change display units to

sectors (command ‘u’).

Command (m for help): m

Command action

a   toggle a bootable flag      #設(shè)定可啟動(dòng)標(biāo)記

b   edit bsd disklabel

c   toggle the dos compatibility flag

d   delete a partition#刪除一個(gè)分區(qū)

l   list known partition types  #各分區(qū)類型所對(duì)應(yīng)的ID

m   print this menu#菜單

n   add a new partition#添加一個(gè)分區(qū)

o   create a new empty DOS partition table

p   print the partition table   #顯示該磁盤下的當(dāng)前分區(qū)信息

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)

知道命令之后就可以進(jìn)行分區(qū)了

Command (m for help): p //打印分區(qū)信息,可以看到當(dāng)前并沒有分區(qū)

Disk /dev/sdc: 21.5 GB,bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of* 512 =bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x45a3cadb

Device Boot      StartEnd      Blocks   Id  System

Command (m for help): n //創(chuàng)建一個(gè)新的分區(qū)

Command action

e   extended//輸入e為創(chuàng)建擴(kuò)展分區(qū)  

p   primary partition (1-4) //輸入p為創(chuàng)建邏輯分區(qū)  

p

Partition number (1-4): 1//劃分邏輯分區(qū)

First cylinder (1-2610, default 1): //我這里直接回車,是不想把該磁盤分成多個(gè)分區(qū),把整個(gè)磁盤作為1個(gè)分區(qū)

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): 

Using default value 2610

Command (m for help): p //再次查看可以看到該磁盤已經(jīng)有1個(gè)分區(qū)了

Disk /dev/sdc: 21.5 GB,bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of* 512 =bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x45a3cadb

Device Boot      StartEnd      Blocks   Id  System

/dev/sdc+  83  Linux

Command (m for help): w //保存分區(qū)

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

再次使用”fdisk -l”命令查看磁盤信息

Disk /dev/sdc: 21.5 GB,bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of* 512 =bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x406a4c58

Device Boot      StartEnd      Blocks   Id  System

/dev/sdc+  83  Linux

第三塊磁盤/dev/sdc已經(jīng)分區(qū)好了

五、格式化分區(qū)

# mkfs.ext3 /dev/sdc1

//將/dev/sdc1格式化為ext3類型,好像大部分的磁盤都是格式化為ext3類型,具體為什么沒有深入研究,暫時(shí)不清楚,想了解的朋友可以自己查一下

# mkfs.ext3 /dev/sdc1

mke2fs 1.41.12 (17-May-2023)

文件系統(tǒng)標(biāo)簽=

操作系統(tǒng):Linux

塊大小=4096 (log=2)

分塊大小=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

inodes,blocks

blocks (5.00%) reserved for the super user

之一個(gè)數(shù)據(jù)塊=0

Maximum filesystem blocks=

160 block groups

32768 blocks per group,fragments per group

8192 inodes per group

Superblock backups stored on blocks: 

32768, 98304,,,,,,,, 

正在寫入inode表: 完成

Creating journal (32768 blocks): 完成

Writing superblocks and filesystem accounting information: 完成

This filesystem will be automatically checked every 31 mounts or

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

格式化完畢,此時(shí)就可以使用“mount”命令掛載分區(qū)了,然后使用這個(gè)磁盤空間了

六、掛載分區(qū)以及開機(jī)自動(dòng)掛載

# df -h //此時(shí)只有sda1和sdb1兩個(gè)磁盤掛載

Filesystem      Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root   18G   15G  1.5G  92% /

tmpfsM   76K  932M   1% /dev/shm

/dev/sdaM   40M  421M   9% /boot

/dev/sdbG  1.2G   18G   7% /disk/diskone

/dev/sr.2G  4.2G% /media/CentOS_6.5_Final

# cd /disk/

# ll

總用量 4

drwxr-xr-x. 4 root root月:04 diskone

# cd diskone/

# ll

總用量 20

drwx——. 2 root root月:12 lost+found

drwxr-xr-x. 2 root root月:09 software

# cd ../

# mkdir disktwo //創(chuàng)建被掛載的路徑

# ll

總用量 8

drwxr-xr-x. 4 root root月:04 diskone

LINUX里用mount怎么掛在硬盤,比如E盤~mount /media/然后呢?!

#man mount

#mount /dev/(你臘仔的掘早硬盤分區(qū)) /(掛輪散汪載點(diǎn)也就是目錄)

首先你要E盤的編擾脊號(hào),比如一般C盤是/dev/sda1,如果實(shí)在不知道,用cfdisk看伍核一下,然后就可以mount了,要建一個(gè)目錄掛載,比如/mnt/e,然后只要運(yùn)行mount /dev/sdax /mnt/e (x是你的E盤的編緩橘滲號(hào))。不過現(xiàn)在一般都是直接點(diǎn)擊就自動(dòng)掛載了。

1.查看可以的硬盤

sfdisk -l

例:

/dev/sda1

/dev/sdb1

….

2. 掛載念咐扮

mount /dev/sdb1 /media #掛載

cd /media #進(jìn)入

ls -l #查簡(jiǎn)沖看仔灶

mount 掛枯豎鋒在目錄 掛載地點(diǎn),纖汪運(yùn)沒晌行mount /dev/sdax /mnt/e (x是你的E盤的編號(hào))??蓞⒖肌禠inux就該這么學(xué)》了解詳細(xì)介紹

mount 掛在目錄 掛載地點(diǎn)

mount /dev/cdrom /media

linux mount 遠(yuǎn)程磁盤的介紹就聊到這里吧,感謝你花時(shí)間閱讀本站內(nèi)容,更多關(guān)于linux mount 遠(yuǎn)程磁盤,如何使用 Linux Mount 掛載遠(yuǎn)程磁盤,linux下如何掛載硬盤?,LINUX里用mount怎么掛在硬盤,比如E盤~mount /media/然后呢?!的信息別忘了在本站進(jìn)行查找喔。

香港服務(wù)器選創(chuàng)新互聯(lián),2H2G首月10元開通。
創(chuàng)新互聯(lián)(www.cdcxhl.com)互聯(lián)網(wǎng)服務(wù)提供商,擁有超過10年的服務(wù)器租用、服務(wù)器托管、云服務(wù)器、虛擬主機(jī)、網(wǎng)站系統(tǒng)開發(fā)經(jīng)驗(yàn)。專業(yè)提供云主機(jī)、虛擬主機(jī)、域名注冊(cè)、VPS主機(jī)、云服務(wù)器、香港云服務(wù)器、免備案服務(wù)器等。


本文題目:如何使用LinuxMount掛載遠(yuǎn)程磁盤(linuxmount遠(yuǎn)程磁盤)
本文地址:http://www.dlmjj.cn/article/djsdheo.html