ubuntu1804 (server版)硬碟掛載-就是無法掛載 [論壇 - Ubuntu基本設定]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



ubuntu1804 (server版)硬碟掛載-就是無法掛載
會員二級
註冊日期:
2011/1/27 15:53
所屬群組:
已註冊使用者
等級: 6
HP : 0 / 148
MP : 21 / 5378
EXP: 95
離線
我的系統是ubuntu 1804 (server版本)
想要掛載隨身碟,但怎麼爬文就是無法解決,請問大家這是什麼問題呢??文如下


root@ubun1804:/# fdisk -l

Disk /dev/loop0: 86.6 MiB, 90759168 bytes, 177264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 89.1 MiB, 93454336 bytes, 182528 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes




Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 752130B7-EC29-454E-A694-2C2B2086DE9E

Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 4198399 4194304 2G Linux swap
/dev/sda3 4198400 56627199 52428800 25G Linux filesystem
/dev/sda4 56627200 77598719 20971520 10G Linux filesystem
/dev/sda5 77598720 119541759 41943040 20G Linux filesystem
/dev/sda6 119541760 140513279 20971520 10G Linux filesystem
/dev/sda7 140513280 3907026943 3766513664 1.8T Linux filesystem


Disk /dev/sdb: 7.5 GiB, 8054112256 bytes, 15730688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
#mkidr /mnt/usb
#mount /dev/sdb /mnt/usb

mount: /mnt/usb: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.

#

2019/10/25 11:49
應用擴展 工具箱
回覆: ubuntu1804 (server版)硬碟掛載-就是無法掛載
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29303
EXP: 6
離線
國一生 寫到:
我的系統是ubuntu 1804 (server版本)
想要掛載隨身碟,但怎麼爬文就是無法解決,請問大家這是什麼問題呢??文如下

root@ubun1804:/# fdisk -l

...略...

Disk /dev/sdb: 7.5 GiB, 8054112256 bytes, 15730688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

#mkidr /mnt/usb
#mount /dev/sdb /mnt/usb

mount: /mnt/usb: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.

#


請先確認您的「USB 隨身碟」,事先已經有做「磁碟分割」和「格式化」。

以我的環境「Ubuntu 18.04」為例,我的「USB 隨身碟」是在「/dev/sdc」。

================================================================================

## 使用「fdisk」觀察

執行


$ sudo fdisk -l /dev/sdc



顯示


Disk /dev/sdc: 7.5 GiB, 8032092160 bytes, 15687680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x30f7592d

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1        2048 15685631 15683584  7.5G  b W95 FAT32



================================================================================

## 使用「lsblk」觀察

執行


$ lsblk /dev/sdc



顯示


NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdc      8:32   1  7.5G  0 disk
└─sdc1   8:33   1  7.5G  0 part




================================================================================

## 建立掛載資料夾

執行下面指令,建立資料夾「/mnt/usb」


$ sudo mkdir -p /mnt/usb



================================================================================

## 執行掛載

執行下面指令,將「/dev/sdc1」掛載到「/mnt/usb」這個資料夾。


$ sudo mount /dev/sdc1 /mnt/usb



================================================================================

## 使用「lsblk」確認掛載是否成功

執行


$ lsblk /dev/sdc



顯示


NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdc      8:32   1  7.5G  0 disk
└─sdc1   8:33   1  7.5G  0 part /mnt/usb



或是執行


$ lsblk /dev/sdc1



顯示

NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdc1   8:33   1  7.5G  0 part /mnt/usb



================================================================================

## 使用「mount」確認掛載是否成功

執行


$ mount | grep sdc



顯示


/dev/sdc1 on /mnt/usb type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)




================================================================================

## 使用「findmnt」確認掛載是否成功

執行


$ findmnt /mnt/usb



或是執行


$ findmnt /dev/sdc1



顯示


TARGET SOURCE FSTYPE OPTIONS
/mnt/usb /dev/sdc1 vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro



================================================================================

可以到「鳥哥的 Linux 私房菜 - 基礎學習篇目錄 / 第二部分 Linux 檔案、目錄與磁碟格式」,找到跟磁碟操作相關的章節。

可以找到「第七章、Linux 磁碟與檔案系統管理」。

例如可以閱讀

* 7.1.1 磁碟組成與分割的複習
* 7.3 磁碟的分割、格式化、檢驗與掛載
* 7.3.1 觀察磁碟分割狀態
* 7.3.5 檔案系統掛載與卸載
* 7.1.7 掛載點的意義 (mount point)


另外還可以閱讀「第二章、主機規劃與磁碟分割 / 2.2 磁碟分割」。

================================================================================

* $ man fdisk
* $ man lsblk
* $ man mount
* $ man umount
* $ man findmnt
* $ man systemd-mount

================================================================================

* https://help.ubuntu.com/community/Mount
* https://help.ubuntu.com/community/Mount/USB
* https://wiki.archlinux.org/index.php/File_systems#Mount_a_file_system

================================================================================

已將此篇連結紀錄到下面兩個討論串

* [索引] 硬碟掛載與檔案系統
* Ubuntu 18.04 LTS (Bionic Beaver) Released

================================================================================

以上提供參考

報告完畢


2019/10/25 19:05
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.