linux格式化分区4t硬盘,Linux下挂载4T大小usb硬盘的经历
【注】都是從網絡上學來的!只是我記錄了一下,免的將來又要掛盤的時候還要一通忙活!
(用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) |
總結
以上是生活随笔為你收集整理的linux格式化分区4t硬盘,Linux下挂载4T大小usb硬盘的经历的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ubuntu20.04挂载4T数据盘流程
- 下一篇: Linux 挂载4T硬盘到根目录