歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Debian 掛載移動硬盤後部分分區無法識別

Debian 掛載移動硬盤後部分分區無法識別

日期:2017/2/28 14:30:52   编辑:Linux教程

有一塊新買的1T的移動硬盤。買來格式化成ntfs後簡單的分了幾次區。 4G的硬盤PE,100G的快速交互,剩余800多G分成了兩個對等的存儲盤。

Debian 7.0 Wheezy 測試體驗 http://www.linuxidc.com/Linux/2013-05/84646.htm

Debian 7.0 Wheezy 發布! http://www.linuxidc.com/Linux/2013-05/83883.htm

硬盤安裝Debian7(Wheezy)以及初級配置 http://www.linuxidc.com/Linux/2013-06/86351.htm

插到電腦USB接口後, 桌面自動彈出了4個盤符。 打開前2個都沒有什麼問題, 寫讀都正常。後面兩個一雙擊就會報錯:

Error mounting: mount exited with exit code 1: helper failed with:
Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at
http://tuxera.com/community/ntfs-3g-faq/#unprivileged

大意就是這個ntfs-3g 沒權限無法掛載,不管是不是root 。

現在我們來解決掉這個問題:

首先看看掛載, 先拔掉移動硬盤 執行 再插上執行, 會發現多了sdb3,sdb5

root@debian:/# cat /etc/mtab 
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=1015602,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=813700k,mode=755 0 0
/dev/disk/by-uuid/4c487d8c-396c-4601-b76d-eff7118d6775 / ext4 rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=4446660k 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
/dev/sdb3 /media/PE vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0
/dev/sdb5 /media/T1 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0

可以看到sdb是我的移動硬盤的, 但是只掛載了2個盤符。

查看下硬盤現狀

fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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
Disk identifier: 0xb73dddb4

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 209719295 104858624 7 HPFS/NTFS/exFAT
Partition 2 does not start on physical sector boundary.
/dev/sda3 1258387456 1925328895 333470720 83 Linux
/dev/sda4 1925330944 1953523711 14096384 82 Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204138496 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953523708 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: 0x6b7612b3

Device Boot Start End Blocks Id System
/dev/sdb1 209921355 839685419 314882032+ 7 HPFS/NTFS/exFAT
/dev/sdb2 839685420 1953520064 556917322+ 7 HPFS/NTFS/exFAT
/dev/sdb3 63 8401994 4200966 b W95 FAT32
/dev/sdb4 8401995 209921354 100759680 f W95 Ext'd (LBA)
/dev/sdb5 8402058 209921354 100759648+ 7 HPFS/NTFS/exFAT

Partition table entries are not in disk order

注意看, 這裡識別了Disk /dev/sdb 1000.2 GB

但是掛載出錯了。 下面報了一個錯,

Partition table entries are not in disk order

說硬盤分區表不在硬盤的順序裡面,意思就是移動硬盤的分區表亂了,

既然是這樣就簡單了, 用fdisk來重建分區表即可, fdisk 掛載設備, 然後f w 就可以更新分區表了。

root@debian:/# fdisk /dev/sdb

Command (m for help): x

Expert command (m for help): f
Done.

Expert command (m for help): m
Command action
b move beginning of data in a partition
c change number of cylinders
d print the raw data in the partition table
e list extended partitions
f fix partition order
g create an IRIX (SGI) partition table
h change number of heads
i change the disk identifier
m print this menu
p print the partition table
q quit without saving changes
r return to main menu
s change number of sectors/track
v verify the partition table
w write table to disk and exit

Expert command (m for help): p

Disk /dev/sdb: 255 heads, 63 sectors, 121601 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 00 1 1 0 254 63 522 63 8401932 0b
2 00 0 1 523 254 63 1023 8401995 201519360 0f
3 00 254 63 1023 254 63 1023 209921355 629764065 07
4 00 254 63 1023 254 63 1023 839685420 1113834645 07
5 00 1 1 523 254 63 1023 63 201519297 07

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

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

這裡就更新成功了分區表, 因為我這是移動硬盤,上面並沒有掛載操作系統OS, 所以不需要更新掛載/etc/fstab 和/boot/grub/menu.list 這幾個文件的對應掛載。

再次執行fdisk -l 發現已經成功掛載, 直接桌面可以直接點進去了。

Disk /dev/sdb: 1000.2 GB, 1000204138496 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953523708 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: 0x6b7612b3

Device Boot Start End Blocks Id System
/dev/sdb1 63 8401994 4200966 b W95 FAT32
/dev/sdb2 8401995 209921354 100759680 f W95 Ext'd (LBA)
/dev/sdb3 209921355 839685419 314882032+ 7 HPFS/NTFS/exFAT
/dev/sdb4 839685420 1953520064 556917322+ 7 HPFS/NTFS/exFAT
/dev/sdb5 8402058 209921354 100759648+ 7 HPFS/NTFS/exFAT

df 看下掛載點成功掛載

root@debian:/# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 328236772 10801844 300761392 4% /
udev 10240 0 10240 0% /dev
tmpfs 813700 972 812728 1% /run
/dev/disk/by-uuid/4c487d8c-396c-4601-b76d-eff7118d6775 328236772 10801844 300761392 4% /
tmpfs 5120 0 5120 0% /run/lock
tmpfs 4446660 26196 4420464 1% /run/shm
/dev/sdb1 4192756 578312 3614444 14% /media/usb0
/dev/sdb5 100759648 14680144 86079504 15% /media/T1
/dev/sdb3 314882032 35480048 279401984 12% /media/T2
/dev/sdb4 556917320 193748248 363169072 35% /media/T3

Copyright © Linux教程網 All Rights Reserved