Ubuntu掛載U盤問(wèn)題
在終端(非圖形界面)掛載U盤,遇到一系列問(wèn)題:
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
老是說(shuō)special device /dev/sdb1 does not exist,無(wú)比郁悶
我以為是前幾天量產(chǎn)優(yōu)盤,優(yōu)盤的分區(qū)表搞出問(wèn)題了。
又發(fā)現(xiàn):
#fdisk /dev/sda
然后輸入a,確定,再輸入w,確定。
接著就可以mount了。
估計(jì)
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
是有個(gè)?這個(gè)咚咚。。。。
量產(chǎn)優(yōu)盤,優(yōu)盤分區(qū)表問(wèn)題大大的有了。我當(dāng)時(shí)沒(méi)備份分區(qū)表,把它量產(chǎn)成活動(dòng)的,用來(lái)做啟動(dòng)盤,在windows下也沒(méi)什么問(wèn)題,就沒(méi)想到它在linux很難識(shí)別該U盤。
如果大家想量產(chǎn)的話,建議先紀(jì)錄量產(chǎn)前的u盤的信息,推薦用chip genius(查看vid、vid\\序列號(hào)之類)還有PowerQuest Partition Table Editor(查看修改分區(qū)表)還有Eisoo DiskGenius(磁盤管理修復(fù)) ,備份分區(qū)表和詳細(xì)信息,否則想恢復(fù)的時(shí)候可能就很麻煩。
我裝了autofs服務(wù):
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
分區(qū)不要1 ?,掛載成功!
自動(dòng)掛載windows分區(qū)
如果你的電腦裝了Windows/Ubuntu雙系統(tǒng),你該有這樣的體會(huì):當(dāng)?shù)卿沀buntu時(shí),系統(tǒng)不會(huì)自動(dòng)掛載Windows下的各分區(qū),只能手動(dòng)掛載。這難免有些麻煩,并在一定意義上違背了Ubuntu追求簡(jiǎn)潔的宗旨。本文將介紹如何解決這個(gè)問(wèn)題,以使在登錄Ubuntu的同時(shí)自動(dòng)掛載Windows分區(qū)。
1.查看電腦中所有硬盤的分區(qū)情況。
命令如下:
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分區(qū),并記下各分區(qū)的文件系統(tǒng)類型。
2.修改/etc/fstab配置文件。
命令如下:
sudo vi /etc/fstab
編輯此配置文件,最終其內(nèi)容類似如下:
# /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行是添加的內(nèi)容。其中/dev/sda1一行代表C盤分區(qū)將自動(dòng)掛載到/media/win-C目錄下,文件系統(tǒng)為NTFS(如果步驟1中查看分區(qū)的文件系統(tǒng)為FAT32時(shí),此處請(qǐng)寫vfat),字符編碼為utf8。umask表示文件目錄的權(quán)限,此參數(shù)以及之后的2個(gè)參數(shù)都為0即可。以下幾行以此類推。此處可以選擇性的添加需要自動(dòng)掛載的分區(qū),不想掛載的分區(qū)不用書(shū)寫。
3.重啟電腦。
編輯、保存上述配置文件之后,請(qǐng)重啟電腦。你將會(huì)看到系統(tǒng)已成功掛載Windows各分區(qū)。