fdiskは、同じパーティションにあるLinuxおよびdosパーティションタイプを表示します。

fdiskは、同じパーティションにあるLinuxおよびdosパーティションタイプを表示します。

次のようにディスクにパーティションを作成しました。

root@vps-90446fc7:~# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-419430399, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-419430399, default 419430399): 

Created a new partition 1 of type 'Linux' and of size 200 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

次に、作成されたパーティションを確認します。

root@vps-90446fc7:~# fdisk -l
Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 sectors
Disk model: QEMU HARDDISK   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xfef6f988

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 419430399 419428352  200G 83 Linux

私は言った:Disklabel type: dosこれはすでに奇妙です。

partedMSDOSパーティションだとしましょう。

root@vps-90446fc7:~# parted -l
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sdb: 215GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  215GB  215GB  primary

e2fsckパーティションが認識されません:

e2fsck -f /dev/sdb1
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdb1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a dos partition table in /dev/sdb1

何が間違っているのかわかりません。ファイルを保存するための一般的なLinux(すべてのタイプ可能)パーティションを作成したいと思います。

ベストアンサー1

デバイスにMBRパーティションテーブル(DOSパーティションテーブルとも呼ばれます)を作成しました/dev/sdb。これにはLinuxパーティションと呼ばれるエントリが含まれています。/dev/sdb1「Linux」ラベルは純粋に情報提供用であり、どの機能も有効または制限しません。

これで、パーティションにファイルシステムを作成する必要があります。

mkfs.ext4 -L data /dev/sdb1

その後、システムにインストールできます。たとえば、次の場所にインストールされます/mnt/dsk

mkdir -p /mnt/dsk
mount /dev/sdb1 /mnt/dsk

ファイルシステムを削除する前にマウント解除する必要があることを覚えている場合は、umount /mnt/dsk()を使用する必要はありませんe2fsck。システムが完全にシャットダウンすると、システムはすべてのファイルシステムを自動的にマウント解除するため、これを直接実行する必要はありません。

おすすめ記事