お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2015-11-29 17:29:50

makopi
メンバ
登録日: 2009-11-01

parted の代わりになる CLI ツールは?

ハードの組み合わせで parted の結果がすべては表示されない現象に遭いましたので報告・質問します。

ubuntu14.04
Groovy USB2 ⇔ SATA,IDE変換 (US-500SA) : 何年も前に購入したもの
HDD HITACHI HDD SATA HDS721010DLE630 (1TB)

gdisk でパーティションを構築してみたのですが、ファイルシステムが parted で表示されていません。
gparted , gdisk では表示されています。

もし必要なら他の方法で調べる必要があります。

CLI では面倒ですが

コード:

sudo udevadm info -q all -n <device filename>

で udev が認識した情報を得られますが、他に良い方法があるでしょうか?(gpt , msdos 形式、双方を認識できるコマンドは他にあるでしょうか?)



コード:

※ ファイルシステムが見られない。

makoto@t552-u1404:~/Desktop$ sudo parted /dev/sdd 
GNU Parted 2.3
/dev/sdd を使用
GNU Parted へようこそ! コマンド一覧を見るには 'help' と入力してください。
(parted) p                                                                
モデル: Hitachi HDS721010DLE630 (scsi)
ディスク /dev/sdd: 1000GB
セクタサイズ (論理/物理): 4096B/4096B
パーティションテーブル: gpt

番号  開始    終了    サイズ  ファイルシステム  名前                  フラグ
 1    1049kB  211MB   210MB                     EFI System Partition  boot
 2    211MB   23.5GB  23.3GB
 4    23.5GB  28.5GB  5039MB
 3    28.5GB  31.3GB  2745MB

(parted) q                                                                
makoto@t552-u1404:~/Desktop$

コード:

makoto@t552-u1404:~/Desktop$ sudo gdisk /dev/sdd
GPT fdisk (gdisk) version 0.8.8

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdd: 244190646 sectors, 931.5 GiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 2B02F173-F724-4334-8FEA-F341E5ABBD38
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 244190640
Partitions will be aligned on 256-sector boundaries
Total free space is 236557227 sectors (902.4 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1             256           51455   200.0 MiB   EF00  EFI System Partition
   2           51456         5733119   21.7 GiB    8300  
   3         6963456         7633663   2.6 GiB     8200  
   4         5733120         6963455   4.7 GiB     8300  

Command (? for help): q
makoto@t552-u1404:~/Desktop$

オフライン

 

#2 2015-11-29 18:11:08

makopi
メンバ
登録日: 2009-11-01

Re: parted の代わりになる CLI ツールは?

Groovy USB2 ⇔ SATA,IDE変換 (US-500SA) : 何年も前に購入したもの

UD-500SA の間違いです。

オフライン

 

#3 2015-11-30 14:59:23

taka.zoo.n
メンバ
登録日: 2013-05-30

Re: parted の代わりになる CLI ツールは?

すいません、ちょっと分からないのですが、

makopi による投稿:

ファイルシステムが parted で表示されていません。

の「ファイルシステム」というのはパーティションエントリーの中のパーティションタイプ GUID(先頭の16byte)のことでしょうか?それともパーティッション中に実際に構築されているファイルシステムタイプ (ext4 とか vfat とか swap とか)のことでしょうか?

私が使っているのは 12.04 なので 14.04 では違ってしまっているかもしれませんが:
前者なら udisks --show-info パーティションデバイス名
後者なら blkid -p パーティションデバイス名
などはいかがでしょうか?

オフライン

 

#4 2015-11-30 16:48:08

makopi
メンバ
登録日: 2009-11-01

Re: parted の代わりになる CLI ツールは?

taka.zoo.n さん、返答ありがとうございます。

私が使っているのは 12.04 なので 14.04 では違ってしまっているかもしれませんが:
前者なら udisks --show-info パーティションデバイス名
後者なら blkid -p パーティションデバイス名
などはいかがでしょうか?

ありがとうございます。時間がとれた時に確認させていただきます。


自分の勘違いもあったようです。

#1 で parted で表示したのは gdisk , mkfs して実際に Debian が動作している状態になっているものです。最後まで書くべきでした。

ubuntu14.04 で試してみたのですが parted で表示されるファイルシステムはパーティション内のファイルシステムが構築された時に更新されるようです。
USBメモリーで確認しました。

コード:

makoto@t552-u1404:~$ sudo gdisk /dev/sdd
[sudo] password for makoto: 
GPT fdisk (gdisk) version 0.8.8

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdd: 61071360 sectors, 29.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): A8E37F07-24AB-44CB-97E6-787A47982191
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 61071326
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        61071326   29.1 GiB    8200  Linux swap

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

Command (? for help): n
Partition number (1-128, default 1): 
First sector (34-61071326, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-61071326, default = 61071326) 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): 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/sdd.
The operation has completed successfully.
makoto@t552-u1404:~$ sudo gdisk /dev/sdd
GPT fdisk (gdisk) version 0.8.8

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdd: 61071360 sectors, 29.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): E74405A2-F405-416B-BC2D-52028E460039
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 61071326
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        61071326   29.1 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/sdd.
The operation has completed successfully.
makoto@t552-u1404:~$ sudo parted /dev/sdd
GNU Parted 2.3
/dev/sdd を使用
GNU Parted へようこそ! コマンド一覧を見るには 'help' と入力してください。
(parted) p                                                                
モデル: Generic USB Flash Disk (scsi)
ディスク /dev/sdd: 31.3GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: gpt

番号  開始    終了    サイズ  ファイルシステム  名前              フラグ
 1    1049kB  31.3GB  31.3GB  linux-swap(v1)    Linux filesystem

(parted) q                                                                
makoto@t552-u1404:~$ sudo mkfs.ext4 /dev/sdd1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1908736 inodes, 7633659 blocks
381682 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
233 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

makoto@t552-u1404:~$ sudo parted /dev/sdd
GNU Parted 2.3
/dev/sdd を使用
GNU Parted へようこそ! コマンド一覧を見るには 'help' と入力してください。
(parted) p                                                                
モデル: Generic USB Flash Disk (scsi)
ディスク /dev/sdd: 31.3GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: gpt

番号  開始    終了    サイズ  ファイルシステム  名前              フラグ
 1    1049kB  31.3GB  31.3GB  ext4              Linux filesystem

(parted) q                                                                
makoto@t552-u1404:~$

そして問題の「HDD+変換アダプター」の方ですが、

コード:

makoto@t552-u1404:~/Desktop$ sudo gdisk /dev/sdd
[sudo] password for makoto: 
GPT fdisk (gdisk) version 0.8.8

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdd: 244190646 sectors, 931.5 GiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 2B02F173-F724-4334-8FEA-F341E5ABBD38
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 244190640
Partitions will be aligned on 256-sector boundaries
Total free space is 244093355 sectors (931.1 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1             256           97535   380.0 MiB   8300  

Command (? for help): d
Using 1

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

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/sdd.
The operation has completed successfully.
makoto@t552-u1404:~/Desktop$ sudo mkswap /dev/sdd1
スワップ空間バージョン1を設定します、サイズ = 976761536 KiB
ラベルはありません, UUID=3575ecfc-3d52-42c6-b2bc-f1f610bd6018
makoto@t552-u1404:~/Desktop$ p
p: コマンドが見つかりません
makoto@t552-u1404:~/Desktop$ sudo parted /dev/sdd
GNU Parted 2.3
/dev/sdd を使用
GNU Parted へようこそ! コマンド一覧を見るには 'help' と入力してください。
(parted) p                                                                
モデル: Hitachi HDS721010DLE630 (scsi)
ディスク /dev/sdd: 1000GB
セクタサイズ (論理/物理): 4096B/4096B
パーティションテーブル: gpt

番号  開始    終了    サイズ  ファイルシステム  名前        フラグ
 1    1049kB  1000GB  1000GB                    Linux swap

(parted) q                                                                
makoto@t552-u1404:~/Desktop$ sudo gdisk /dev/sdd
GPT fdisk (gdisk) version 0.8.8

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

Found valid GPT with protective MBR; using GPT.

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/sdd: 244190646 sectors, 931.5 GiB
Logical sector size: 4096 bytes
Disk identifier (GUID): AB8A9F7A-C32A-4AAD-8F09-DBF86A6E1DC8
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 244190640
Partitions will be aligned on 256-sector boundaries
Total free space is 244190635 sectors (931.5 GiB)

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

Command (? for help): n
Partition number (1-128, default 1): 
First sector (6-244190640, default = 256) or {+-}size{KMGTP}: 
Last sector (256-244190640, default = 244190640) 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): 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/sdd.
The operation has completed successfully.
makoto@t552-u1404:~/Desktop$ sudo parted /dev/sdd
GNU Parted 2.3
/dev/sdd を使用
GNU Parted へようこそ! コマンド一覧を見るには 'help' と入力してください。
(parted) p                                                                
モデル: Hitachi HDS721010DLE630 (scsi)
ディスク /dev/sdd: 1000GB
セクタサイズ (論理/物理): 4096B/4096B
パーティションテーブル: gpt

番号  開始    終了    サイズ  ファイルシステム  名前              フラグ
 1    1049kB  1000GB  1000GB                    Linux filesystem

(parted) q                                                                
makoto@t552-u1404:~/Desktop$ sudo mkfs.ext4 /dev/sdd1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61054976 inodes, 244190385 blocks
12209519 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 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

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done     

makoto@t552-u1404:~/Desktop$ sync
makoto@t552-u1404:~/Desktop$ sudo parted /dev/sdd
GNU Parted 2.3
/dev/sdd を使用
GNU Parted へようこそ! コマンド一覧を見るには 'help' と入力してください。
(parted) p                                                                
モデル: Hitachi HDS721010DLE630 (scsi)
ディスク /dev/sdd: 1000GB
セクタサイズ (論理/物理): 4096B/4096B
パーティションテーブル: gpt

番号  開始    終了    サイズ  ファイルシステム  名前              フラグ
 1    1049kB  1000GB  1000GB                    Linux filesystem

(parted) q                                                                
makoto@t552-u1404:~/Desktop$

オフライン

 

#5 2016-01-22 22:40:25

makopi
メンバ
登録日: 2009-11-01

Re: parted の代わりになる CLI ツールは?

https://forums.ubuntulinux.jp/viewtopic.php?id=18066
の通り、
parted の表示の不具合は Xenial (16.04)  '16.01.19 開発版では修正されているようです。

オフライン

 

Board footer

Powered by FluxBB