国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Ubuntu > 正文

Ubuntu系統上掛載U盤和Windows分區問題的解決實例

2020-10-18 20:37:26
字體:
來源:轉載
供稿:網友

Ubuntu掛載U盤問題
在終端(非圖形界面)掛載U盤,遇到一系列問題:

復制代碼
代碼如下:

flc@ubuntu:~$ sudo mount -t vfat -o iocharset=utf8 /dev/sdb1 /media/udisk
mount: special device /dev/sdb1 does not exist
flc@ubuntu:/$ sudo fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 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 identifier: 0x00082ba2
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 61868031 30932992 83 Linux
/dev/sda2 61870078 62912511 521217 5 Extended
/dev/sda5 61870080 62912511 521216 82 Linux swap / Solaris
Disk /dev/sdb: 8011 MB, 8011120640 bytes
247 heads, 62 sectors/track, 1021 cylinders, total 15646720 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 identifier: 0x6f20736b
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/sdb1 778135908 1919645538 570754815+ 72 Unknown
/dev/sdb2 ? 168689522 2104717761 968014120 65 Novell Netware 386
/dev/sdb3 ? 1869881465 3805909656 968014096 79 Unknown
/dev/sdb4 ? 2885681152 2885736650 27749+ d Unknown
Partition table entries are not in disk order

老是說special device /dev/sdb1 does not exist,無比郁悶
我以為是前幾天量產優盤,優盤的分區表搞出問題了。
又發現:

復制代碼
代碼如下:
#fdisk /dev/sda

然后輸入a,確定,再輸入w,確定。
接著就可以mount了。
估計

復制代碼
代碼如下:

Device Boot Start End Blocks Id System
/dev/sdb1 778135908 1919645538 570754815+ 72 Unknown
/dev/sdb2 ? 168689522 2104717761 968014120 65 Novell Netware 386
/dev/sdb3 ? 1869881465 3805909656 968014096 79 Unknown
/dev/sdb4 ? 2885681152 2885736650 27749+ d Unknown

是有個?這個咚咚。。。。
量產優盤,優盤分區表問題大大的有了。我當時沒備份分區表,把它量產成活動的,用來做啟動盤,在windows下也沒什么問題,就沒想到它在linux很難識別該U盤。
如果大家想量產的話,建議先紀錄量產前的u盤的信息,推薦用chip genius(查看vid、vid//序列號之類)還有PowerQuest Partition Table Editor(查看修改分區表)還有Eisoo DiskGenius(磁盤管理修復) ,備份分區表和詳細信息,否則想恢復的時候可能就很麻煩。
我裝了autofs服務:


復制代碼
代碼如下:

flc@ubuntu:~$ sudo apt-get install autofs
flc@ubuntu:~$ sudo fdisk /dev/sdb
Command (m for help): a
Partition number (1-4): 1
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): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.


最后:

復制代碼
代碼如下:

flc@ubuntu:~$ sudo mount -t vfat -o iocharset=utf8 /dev/sdb /media/udisk

分區不要1  ?,掛載成功!

自動掛載windows分區
如果你的電腦裝了Windows/Ubuntu雙系統,你該有這樣的體會:當登錄Ubuntu時,系統不會自動掛載Windows下的各分區,只能手動掛載。這難免有些麻煩,并在一定意義上違背了Ubuntu追求簡潔的宗旨。本文將介紹如何解決這個問題,以使在登錄Ubuntu的同時自動掛載Windows分區。

1.查看電腦中所有硬盤的分區情況。
命令如下:

復制代碼
代碼如下:

sudo fdisk -l

此命令將輸出類似如下的信息:

復制代碼
代碼如下:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf0b1ebb0</p><p> Device Boot Start End Blocks Id System
/dev/sda1 * 1 3825 30724281 7 HPFS/NTFS
/dev/sda2 3826 60802 457661193 f W95 Ext'd (LBA)
/dev/sda5 3826 16574 102406311 7 HPFS/NTFS
/dev/sda6 16575 29323 102406311 7 HPFS/NTFS
/dev/sda7 29324 54427 201647848+ 7 HPFS/NTFS
/dev/sda8 54428 54552 999424 82 Linux swap / Solaris
/dev/sda9 54552 60802 50199552 83 Linux

注:上述列表中/dev/sda1、/dev/sda5、/dev/sda6、/dev/sda7分別代表Windows中的C、D、E、F分區,并記下各分區的文件系統類型。

2.修改/etc/fstab配置文件。
命令如下:

復制代碼
代碼如下:

sudo vi /etc/fstab

編輯此配置文件,最終其內容類似如下:

復制代碼
代碼如下:

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda7 during installation
UUID=ac4326f1-50ad-457f-8e99-63174b97bc88 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=9026c543-3172-4d21-bce0-dbe595a1425d none swap sw 0 0
#auto mount windows fs
/dev/sda1 /media/win-C ntfs nls=utf8,umask=000 0 0
/dev/sda5 /media/win-D ntfs nls=utf8,umask=000 0 0
/dev/sda6 /media/win-E ntfs nls=utf8,umask=000 0 0
/dev/sda7 /media/win-F ntfs nls=utf8,umask=000 0 0

注:末尾的5行是添加的內容。其中/dev/sda1一行代表C盤分區將自動掛載到/media/win-C目錄下,文件系統為NTFS(如果步驟1中查看分區的文件系統為FAT32時,此處請寫vfat),字符編碼為utf8。umask表示文件目錄的權限,此參數以及之后的2個參數都為0即可。以下幾行以此類推。此處可以選擇性的添加需要自動掛載的分區,不想掛載的分區不用書寫。

3.重啟電腦。
編輯、保存上述配置文件之后,請重啟電腦。你將會看到系統已成功掛載Windows各分區。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 丰宁| 吉隆县| 兴城市| 清流县| 明溪县| 信丰县| 余庆县| 酒泉市| 甘南县| 余干县| 如东县| 安福县| 乐安县| 诏安县| 罗山县| 西盟| 陆良县| 大名县| 罗田县| 钟祥市| 穆棱市| 于田县| 长沙县| 扎鲁特旗| 原平市| 醴陵市| 东乡族自治县| 香港| 和硕县| 松滋市| 嵩明县| 江门市| 宝鸡市| 托克托县| 桃源县| 丰城市| 嘉峪关市| 讷河市| 泾阳县| 天台县| 汶川县|