【注】都是从网络上学来的!只是我记录了一下,免的将来又要挂盘的时候还要一通忙活!
(用ntfs-3g没有挂成功!)
1、先去win7下进入磁盘管理里在这个大盘上单击右键,转换成GPT分区格式!
2、挂到Linux机器上,用fdisk -l看看!能看到。(但不用它)
3、下载最新的parted安装。
4、用parted挂载。
5、格式化成ext3文件系统。
6、mount 这个大盘。(机器自动进行的。)
7、在启动机器的状态下,修改/etc/fstab文件。
机器是rehl5,uname -r显示是:
[root@pc03 ~]# uname -r
2.6.18-308.el5
下载最新的parted是3.1
[root@pc03 ~]# xz -d parted-3.1.tar.xz
[root@pc03 ~]# tar xvf parted-3.1.tar
[root@pc03 ~]# cd parted-3.1
[root@pc03 parted-3.1]#./configure
[root@pc03 parted-3.1]#make
[root@pc03 parted-3.1]#make install
[root@pc03 parted-3.1]#reboot
插上usb的盘:
[root@pc03 ~]# fdisk -l
Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5099 40957686 83 Linux
/dev/sda2 5100 241162 1896176047+ 83 Linux
/dev/sda3 241163 243201 16378267+ 82 Linux swap / Solaris
Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 243201 1953512001 83 Linux
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn
't support GPT. Use GNU Parted.
Note: sector size is 4096 (not 512)
WARNING: The size of this disk is 4.0 TB (4000787025920 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID
partition table format (GPT).
Disk /dev/sdc: 4000.7 GB, 4000787025920 bytes
255 heads, 63 sectors/track, 60800 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 60801 3907018576 ee EFI GPT
[root@pc03 ~]# parted /dev/sdc
GNU Parted 3.1
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: Seagate Expansion Desk (scsi)
Disk /dev/sdc: 4001GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 4001GB 4001GB primary
(parted) mklabel
New disk label type? gpt
Warning: The existing disk label on /dev/sdc will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? y
Error: Partition(s) 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc have been
written, but we have been unable to inform the kernel of the change, probably
because it/they are in use. As a result, the old partition(s) will remain in
use. You should reboot now before making further changes.
Ignore/Cancel? i
(parted) mkpart
Partition name? []? primary
File system type? [ext2]? ext3
Start? 0
End? -1
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i
Error: Partition(s) 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc have been
written, but we have been unable to inform the kernel of the change, probably
because it/they are in use. As a result, the old partition(s) will remain in
use. You should reboot now before making further changes.
Ignore/Cancel? i
(parted) quit
Information: You may need to update /etc/fstab.
[root@pc03 ~]#mkfs -t ext3 /dev/sdc
格式化完成后,还没有mount,机器自己就认识了这块盘。像u盘一样!
本来到此很顺利的就完成了!
结果我去/etc/fstab中加了一行
/dev/sdc /data2 ext3 default 1 2
机器再启动就启动不起来了!提示我输入root密码进入维护状态。按ctrl+D进去普通启动,可是如果按了ctrl+D就是重新启动。如同进入死循环!只有输入root的密码进入维护状态!
又去网络上查找,结果找到一条:在维护状态下进入可读写状态:
(repair filesystem)1#cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/pc /pc ext3 defaults 1 2
LABEL=/pb /pb ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
/dev/sdc /data2 ext3 default 1 2
(repair filesystem)2#mount -o remount ,rw /dev/sda1/
(repair filesystem)3#vi /etc/fstab
赶紧把画蛇添足的那一行删除!
重新启动,重新parted操作一遍,机器自动看到了:
[root@pc03 ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 39674192 27883852 9742456 75% /
/dev/sdb1 1892332912 1672125788 122531524 94% /pc
/dev/sda2 1836794736 1404240736 337745200 81% /pb
tmpfs 6150204 0 6150204 0% /dev/shm
/dev/sdc1 3845709688 191754384 3458604428 6% /media/disk
/dev/sdd1 1953513556 482918480 1470595076 25% /home1
[root@pc03 ~]#
就算我成功了!
只是每一次只要重新启动了机器都要parted一回!
阅读(8361) | 评论(0) | 转发(0) |