系统:Ubuntu + WindowsXP 硬盘: SDR(主) + SATA(从)
前段时间sata的硬盘坏了,拿去保修后回来,重新分区下,发现ubuntu下无法自动识别,后来找了些资料才知道,是需要重新挂载.
首先,找出系统标示的磁盘的 盘符/编号:
sudo lshw -C disk
---------得到输出------------
*-disk description: SCSI Disk product: WDC WD400BB-00DE vendor: ATA physical id: 0.1.0 bus info: scsi@0:0.1.0 logical name: /dev/sda version: 05.0 serial: WD-WCAD19846550 size: 37GB capabilities: partitioned partitioned:dos configuration: ansiversion=5 *-volume:0 description: W95 FAT32 (LBA) partition physical id: 1 bus info: scsi@0:0.1.0,1 logical name: /dev/sda1 capacity: 8228MB capabilities: primary bootable *-volume:1 description: Extended partition physical id: 2 bus info: scsi@0:0.1.0,2 logical name: /dev/sda2 size: 29GB capacity: 29GB capabilities: primary extended partitioned partitioned:extended *-logicalvolume:0 description: W95 FAT32 partition physical id: 5 logical name: /dev/sda5 capacity: 9977MB *-logicalvolume:1 description: W95 FAT32 partition physical id: 6 logical name: /dev/sda6 capacity: 9977MB *-logicalvolume:2 description: Linux swap / Solaris partition physical id: 7 logical name: /dev/sda7 capacity: 996MB capabilities: nofs *-logicalvolume:3 description: Linux filesystem partition physical id: 8 logical name: /dev/sda8 capacity: 8981MB *-disk description: SCSI Disk product: SAMSUNG HD080HJ vendor: ATA physical id: 0.1.0 bus info: scsi@2:0.1.0 logical name: /dev/sdb version: ZH10 serial: 351011CP411680 size: 74GB capabilities: partitioned partitioned:dos configuration: ansiversion=5 *-volume:0 description: W95 FAT32 (LBA) partition physical id: 1 bus info: scsi@2:0.1.0,1 logical name: /dev/sdb1 capacity: 20GB capabilities: primary bootable *-volume:1 description: Extended partition physical id: 2 bus info: scsi@2:0.1.0,2 logical name: /dev/sdb2 size: 54GB capacity: 54GB capabilities: primary extended partitioned partitioned:extended *-logicalvolume:0 description: W95 FAT32 partition physical id: 5 logical name: /dev/sdb5 capacity: 24GB *-logicalvolume:1 description: W95 FAT32 partition physical id: 6 logical name: /dev/sdb6 capacity: 30GB -------------------------------------- 我是sata的从盘无法识别,所以找出logical name: /dev/sdb1 /dev/sdb5 /dev/sdb6
注意:
分区共有三种主分区、扩展分区和逻辑分区(如图)。在一个硬盘上主分区只有一个,扩展分区可以有三个,在Windows中只支持一个扩展分区,所以(在一个硬盘的情况下) Windows中D盘是扩展分区中的第一个逻辑分区。而在Linux中主分区和扩展分区用1~4来表示,而逻辑分区是从5开始编号的。因此,D盘在 linux中应该是hda5。如果第一个IDE硬盘并分为C、D、E、F四个分区,那么在Linux中则分别为hda1、hda5、hda6、hda7 了,hda2 其实是不存在的,他是hda6+hda7!
然后就可以挂载上去了,但是,这样挂载出来的分区是只读的,而且中文会出现乱码!!!
#新建一个文件夹,作为挂载点sda1 ,下同 sudo mkdir /media/sda1 #把第一个卷挂载到sda1上去,下同 sudo mount /dev/sdb1 /media/sda1
sudo mkdir /media/sda2 sudo mount /dev/sdb2 /media/sda2
sudo mkdir /media/sda3 sudo mount /dev/sdb5 /media/sda3 sudo mkdir /media/sda4 sudo mount /dev/sdb6 /media/sda4
如果需要让系统自动识别的话,可以编辑/etc/fstab 利用 ls -l /dev/disk/by-uuid/ 得到各个分区的编号
lrwxrwxrwx 1 root root 10 2007-10-08 10:04 1909-E93C -> ../../sda6 lrwxrwxrwx 1 root root 10 2007-10-08 10:04 338df5d1-66da-49ed-8d16-e2474c47352d -> ../../sda7 lrwxrwxrwx 1 root root 10 2007-10-08 10:04 411B-6DE9 -> ../../sdb1 lrwxrwxrwx 1 root root 10 2007-10-08 10:04 4703-EBB3 -> ../../sdb6 lrwxrwxrwx 1 root root 10 2007-10-08 10:04 4CDC-1AD6 -> ../../sda1 lrwxrwxrwx 1 root root 10 2007-10-08 10:04 8236-DBD6 -> ../../sdb5 lrwxrwxrwx 1 root root 10 2007-10-08 10:04 d25ac88b-4914-48c7-aa05-dbbe2074487e -> ../../sda8 lrwxrwxrwx 1 root root 10 2007-10-08 10:04 D2C7-6EE7 -> ../../sda5
然后到fstab里面把对应的项做修改
|