もらった1T HDD gdisk xfsで普通にマウント

面白みもなく普通に

[code lang=text] [root@n54l ~]# uname -a Linux n54l 2.6.32-573.26.1.el6.x86_64 #1 SMP Wed May 4 00:57:44 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux [root@n54l ~]# gdisk --version GPT fdisk (gdisk) version 0.8.10

Problem opening --version for reading! Error is 2. The specified file does not exist! [/code]

ぶっさして確認する MOUNTPOINTがないのでわかりやすい

[code lang=text] [root@n54l ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom
sdc 8:32 0 931.5G 0 disk └─sdc1 8:33 0 931.5G 0 part /hdd2 sdd 8:48 0 931.5G 0 disk └─sdd1 8:49 0 931.5G 0 part /hdd3 sdb 8:16 0 1.8T 0 disk └─sdb1 8:17 0 1.8T 0 part /hdd1 sde 8:64 0 931.5G 0 disk └─sde1 8:65 0 931.5G 0 part sda 8:0 1 14.5G 0 disk ├─sda1 8:1 1 500M 0 part /boot └─sda2 8:2 1 14G 0 part ├─vg_n54l-lv_root (dm-0) 253:0 0 10.2G 0 lvm / └─vg_n54l-lv_swap (dm-1) 253:1 0 3.8G 0 lvm [SWAP] [root@n54l ~]# gdisk -l /dev/sde GPT fdisk (gdisk) version 0.8.10

Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: not present


Found invalid GPT and valid MBR; converting MBR to GPT format in memory.


Disk /dev/sde: 1953525168 sectors, 931.5 GiB Logical sector size: 512 bytes Disk identifier (GUID): 6A89DC33-660C-4AA5-9824-56ADF0524140 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 1953525134 Partitions will be aligned on 2048-sector boundaries Total free space is 5485 sectors (2.7 MiB)

Number Start (sector) End (sector) Size Code Name 1 2048 1953521663 931.5 GiB 0700 Microsoft basic data [/code]

gdisk を起動してもともとあったパーティションを消す

[code lang=text] [root@n54l ~]# gdisk /dev/sde GPT fdisk (gdisk) version 0.8.10

Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: not present


Found invalid GPT and valid MBR; converting MBR to GPT format in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if you don't want to convert your MBR partitions to GPT format!


Command (? for help): d Using 1

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!

Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sde. The operation has completed successfully. [root@n54l ~]# [/code]

一応zeroを突っ込む

[code lang=text] [root@n54l ~]# dd if=/dev/zero of=/dev/sde ^C1599001+0 records in 1599001+0 records out 818688512 bytes (819 MB) copied, 19.7958 s, 41.4 MB/s [/code]

パーティションを切る ただのデータ保存用になるのでへんな切り方はしない o (create a new empty GUID partition table (GPT)) にて GPT に初期化する。

[code lang=text] [root@n54l ~]# gdisk /dev/sde GPT fdisk (gdisk) version 0.8.10

Caution: invalid main GPT header, but valid backup; regenerating main header from backup!

Caution! After loading partitions, the CRC doesn't check out! Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan: MBR: not present BSD: not present APM: not present GPT: damaged

Found invalid MBR and corrupt GPT. What do you want to do? (Using the GPT MAY permit recovery of GPT data.) 1 - Use current GPT 2 - Create blank GPT

Your answer: 1

Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): Y

Command (? for help): p Disk /dev/sde: 1953525168 sectors, 931.5 GiB Logical sector size: 512 bytes Disk identifier (GUID): 6A6D92DE-99E6-4F49-86D0-BDD41CCB9D3C Partition table holds up to 128 entries First usable sector is 34, last usable sector is 1953525134 Partitions will be aligned on 2048-sector boundaries Total free space is 1953525101 sectors (931.5 GiB)

Number Start (sector) End (sector) Size Code Name

Command (? for help): n Partition number (1-128, default 1): First sector (34-1953525134, default = 2048) or {+-}size{KMGTP}: Last sector (2048-1953525134, default = 1953525134) or {+-}size{KMGTP}: Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem'

Command (? for help): p Disk /dev/sde: 1953525168 sectors, 931.5 GiB Logical sector size: 512 bytes Disk identifier (GUID): 6A6D92DE-99E6-4F49-86D0-BDD41CCB9D3C Partition table holds up to 128 entries First usable sector is 34, last usable sector is 1953525134 Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name 1 2048 1953525134 931.5 GiB 8300 Linux filesystem

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!

Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sde. The operation has completed successfully.

[/code]

いつもどおりファイルシステムはxfsで <a href="Linux">http://qiita.com/sion_cojp/items/c8e015db39ddbf43012e">Linuxファイルシステムをまとめてみました</a>

[code lang=text] [root@n54l ~]# mkfs.xfs /dev/sde1 meta-data=/dev/sde1 isize=256 agcount=32, agsize=7630950 blks = sectsz=4096 attr=2, projid32bit=0 data = bsize=4096 blocks=244190385, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal log bsize=4096 blocks=119233, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [/code]

uuidを確認

[code lang=text] [root@n54l ~]# ls -l /dev/disk/by-uuid 合計 0 lrwxrwxrwx 1 root root 10 5月 6 16:11 2016 06cf1346-b2e7-48be-ad29-6d79e9bbfde6 -> ../../sde1 lrwxrwxrwx 1 root root 10 5月 5 03:48 2016 1611fc31-c829-4fc5-8b50-245b19311f73 -> ../../sdb1 lrwxrwxrwx 1 root root 10 5月 5 03:48 2016 41ea0e75-4e7d-488c-8494-19ded4248556 -> ../../dm-1 lrwxrwxrwx 1 root root 10 5月 5 03:48 2016 4b8b299b-7a28-4853-8846-4f2f5df790d3 -> ../../sdc1 lrwxrwxrwx 1 root root 10 5月 5 03:48 2016 a46ffd3d-e961-4147-ad06-a937b529dd87 -> ../../sda1 lrwxrwxrwx 1 root root 10 5月 5 03:48 2016 c70d4dcc-2565-4ecf-8585-817434b9a86b -> ../../dm-0 lrwxrwxrwx 1 root root 10 5月 5 03:48 2016 f36ac49a-bb57-4c37-994c-1e1663ff5a8f -> ../../sdd1 [/code]

/hdd4にマウントする fstabに追記する

[code lang=text] [root@n54l ~]# mkdir /hdd4 [root@n54l ~]# cat /etc/fstab | tail -n 2 UUID=f36ac49a-bb57-4c37-994c-1e1663ff5a8f /hdd3 xfs defaults 0 0 UUID=06cf1346-b2e7-48be-ad29-6d79e9bbfde6 /hdd4 xfs defaults 0 0 [/code]

[code lang=text] [root@n54l ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_n54l-lv_root 10G 4.9G 4.6G 52% / tmpfs 2.8G 0 2.8G 0% /dev/shm /dev/sda1 477M 149M 304M 33% /boot /dev/sdb1 1.8T 741G 1000G 43% /hdd1 /dev/sdc1 917G 685G 186G 79% /hdd2 /dev/sdd1 932G 790G 143G 85% /hdd3 [root@n54l ~]# [root@n54l ~]# [root@n54l ~]# mount -a [root@n54l ~]# [root@n54l ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_n54l-lv_root 10G 4.9G 4.6G 52% / tmpfs 2.8G 0 2.8G 0% /dev/shm /dev/sda1 477M 149M 304M 33% /boot /dev/sdb1 1.8T 741G 1000G 43% /hdd1 /dev/sdc1 917G 685G 186G 79% /hdd2 /dev/sdd1 932G 790G 143G 85% /hdd3 /dev/sde1 932G 34M 932G 1% /hdd4 [/code]

おわり