日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux分区命令parted6,Linux parted命令支持T级分区

發布時間:2024/1/18 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux分区命令parted6,Linux parted命令支持T级分区 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

[root@abintel ~]# parted –help

用法:parted [選項]… [設備 [命令 [參數]…]…]

將帶有“參數”的命令應用于“設備”。如果沒有給出“命令”,則以交互模式運行。

選項:

-h, –help????????????????????顯示此求助信息

-i, –interactive???????????? 在必要時,提示用戶

-s, –script??????????????????從不提示用戶

-v, –version???????????????? 顯示版本

命令:

檢查 MINOR?????????????????? 對文件系統進行一個簡單的檢查

cp [FROM-DEVICE] FROM-MINOR TO-MINOR??????將文件系統復制到另一個分區

help [COMMAND]????????????????打印通用求助信息,或關于 COMMAND 的信息

mklabel 標簽類型??????????????創建新的磁盤標簽 (分區表)

mkfs MINOR 文件系統類型?????? 在 MINOR 創建類型為“文件系統類型”的文件系統

mkpart 分區類型 [文件系統類型] 起始點 終止點??????創建一個分區

mkpartfs 分區類型 文件系統類型 起始點 終止點 創建一個帶有文件系統的分區

move MINOR 起始點 終止點??????移動編號為 MINOR 的分區

name MINOR 名稱?????????????? 將編號為 MINOR 的分區命名為“名稱”

print [MINOR]???????????????? 打印分區表,或者分區

quit??????????????????????????退出程序

rescue 起始點 終止點??????????挽救臨近“起始點”、“終止點”的遺失的分區

resize MINOR 起始點 終止點????改變位于編號為 MINOR 的分區中文件系統的大小

rm MINOR??????????????????????刪除編號為 MINOR 的分區

select 設備???????????????? 選擇要編輯的設備

set MINOR 標志 狀態?????????? 改變編號為 MINOR 的分區的標志

大于1T的磁盤進行分區

遇到一個問題,大磁盤的超過1T的時候fdisk無法分區,到網上找了半天才知道是用parted可以作,有網絡真好啊.:D

下面一塊有3T RAID的硬盤的分區情況

#parted /dev/sdc

GNU Parted 1.6.19

Copyright (C) 1998 – 2004 Free Software Foundation, Inc.

This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Using /dev/sdc

(parted) m

check MINOR do a simple check on the filesystem

cp [FROM-DEVICE] FROM-MINOR TO-MINOR copy filesystem to another partition

help [COMMAND] prints general help, or help on COMMAND

mklabel LABEL-TYPE create a new disklabel (partition table)

mkfs MINOR FS-TYPE make a filesystem FS-TYPE on partititon MINOR

mkpart PART-TYPE [FS-TYPE] START END make a partition

mkpartfs PART-TYPE FS-TYPE START END make a partition with a filesystem

move MINOR START END move partition MINOR

name MINOR NAME name partition MINOR NAME

print [MINOR] display the partition table, or a partition

quit exit program

rescue START END rescue a lost partition near START and END

resize MINOR START END resize filesystem on partition MINOR

rm MINOR delete partition MINOR

select DEVICE choose the device to edit

set MINOR FLAG STATE change a flag on partition MINOR

(parted) p

Disk geometry for /dev/sdc: 0.000-2860032.000 megabytes

Disk label type: gpt

Minor Start End Filesystem Name Flags

1 0.017 1000.000 ext3

2 1000.000 2000.000 ext3

3 2000.000 3000.000 ext3

(parted) rm 3

(parted) rm 2

(parted) rm 1

(parted) mkpartfs primary ext3 0 1000000

No Implementation: Support for creating ext3 file systems is not implemented yet.

(parted) mkpart primary 0 1000000

(parted) mkpart primary 1000000 2000000

(parted) mkpart primary 2000000 3000000

Error: Can’t have a partition outside the disk!

(parted) mkpart primary 2000000 2800000

(parted) q

Information: Don’t forget to update /etc/fstab, if necessary.

#mkfs.ext3 /dev/sdc1

mke2fs 1.35 (28-Feb-2004)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

128008192 inodes, 255999995 blocks

12799999 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=260046848

7813 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

102400000, 214990848

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information:

done

This filesystem will be automatically checked every 20 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

背景:構建圖書館光盤管理系統FTP,6塊硬盤,每個1TB,用一塊硬盤做raid0,安裝系統,剩余5塊做raid5。由于ext3文件系統不支持大于2TB的分區,所以考慮使用GPT首先以root身份登錄系統,查看硬盤信息:fdisk -l

復制內容到剪貼板

代碼:

[root@libftp ~]# fdisk -l

Disk /dev/cciss/c0d0: 1000.1 GB, 1000171331584 bytes

255 heads, 63 sectors/track, 121597 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot??????Start???????? End??????Blocks?? Id System

/dev/cciss/c0d0p1?? *?????????? 1??????????33??????265041?? 83 Linux

/dev/cciss/c0d0p2??????????????34??????116105?? 932348340?? 83 Linux

/dev/cciss/c0d0p3??????????116106??????118655????20482875?? 83 Linux

/dev/cciss/c0d0p4??????????118656??????121597????23631615????5 Extended

/dev/cciss/c0d0p5??????????118656??????120567????15358108+ 83 Linux

/dev/cciss/c0d0p6??????????120568??????121587???? 8193118+ 82 Linux swap / Solaris

WARNING: GPT (GUID Partition Table) detected on ‘/dev/cciss/c0d1′! The util fdisk doesn’t support GPT. Use GNU Parted.

Disk /dev/cciss/c0d1: 4000.6 GB, 4000684662784 bytes

255 heads, 63 sectors/track, 486388 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot??????Start???????? End??????Blocks?? Id System

/dev/cciss/c0d1p1?????????????? 1??????267350 2147483647+ ee EFI GPT

使用parted命令:

復制內容到剪貼板

代碼:

[root@libftp ~]# parted /dev/cciss/c0d1

GNU Parted 1.8.1

Using /dev/cciss/c0d1

Welcome to GNU Parted! Type ‘help’ to view a list of commands.

(parted) mklabel gpt

Warning: The existing disk label on /dev/cciss/c0d1 will be destroyed and all data on this disk will be lost. Do you want to

continue?

Yes/No? y

New disk label type? [gpt]? gpt

下一步:由MBR轉為GPT磁盤

復制內容到剪貼板

代碼:

(parted) mkpart primary 0 4000GB

print:

復制內容到剪貼板

代碼:

(parted) print

Model: Compaq Smart Array (cpqarray)

Disk /dev/cciss/c0d1: 4001GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start?? End???? Size????File system Name???? Flags

1??????17.4kB 4001GB 4001GB?????????????? primary

(parted) quit

Information: Don’t forget to update /etc/fstab, if necessary.

下一步:格式化

復制內容到剪貼板

代碼:

[root@libftp ~]# mkfs.ext3 -F /dev/cciss/c0d1

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

488374272 inodes, 976729654 blocks

48836482 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

29808 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

102400000, 214990848, 512000000, 550731776, 644972544

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

此時注意事項:mkfs.ext3 -F?? 后面要跟上 -F下一步 :掛載

復制內容到剪貼板

代碼:

[root@libftp ~]# mkdir -p /mnt/cciss/c0d1

[root@libftp ~]# mount /dev/cciss/c0d1 /mnt/cciss/c0d1

查看:

復制內容到剪貼板

代碼:

[root@libftp ~]# df -h

Filesystem????????????Size Used Avail Use% Mounted on

/dev/cciss/c0d0p5??????15G 1.8G?? 12G 13% /

/dev/cciss/c0d0p3??????19G 173M?? 18G?? 1% /usr/local

/dev/cciss/c0d0p2???? 862G 200M 817G?? 1% /else

/dev/cciss/c0d0p1???? 251M?? 21M 218M?? 9% /boot

tmpfs???????????????? 2.0G???? 0 2.0G?? 0% /dev/shm

/dev/cciss/c0d1?????? 3.6T 197M 3.4T?? 1% /mnt/cciss/c0d1

開機自動掛載這塊硬盤:vi /etc/rc.local加上:

復制內容到剪貼板

代碼:

mount /dev/cciss/c0d1 /mnt/cciss/c0d1

搞定.

因為fdisk是不支持GPT磁盤,所以不要使用fdisk -l來查看X磁盤剛才分好的區,看不到的

總結

以上是生活随笔為你收集整理的linux分区命令parted6,Linux parted命令支持T级分区的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。