0

I have created a partition on my disk like this:

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.

Then I check the created partition:

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

I says: Disklabel type: dos which is already weird.

parted says is MSDOS partition:

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 doesn't recognize the partition:

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

I don't know what I am doing wrong. I just want to create a normal Linux (whatever type is good) partition to store files.

fguillen
  • 36,125
  • 23
  • 149
  • 210
  • 3
    Please re-read the guidance for the tags you've used. This is clearly a question about system administration, not about __programming__, so is off-topic for Stack Overflow. It _might_ be suitable for [sf] or [unix.se]: consult the Help Centre for the site before you post. – Toby Speight Aug 27 '23 at 15:06
  • 2
    At least that `e2fsck` doesn't detect it correctly is simple: you just created a partition, but haven't *written anything to it* or created a file system on it. So what's there is probably garbage (or zeroes, if the disk is new). – Joachim Sauer Aug 27 '23 at 15:06
  • 1
    In any case, you seem to have partitioned the disk, but haven't created a filesystem on the new partition. You need something like `mke2fs /dev/sdb1`. – Toby Speight Aug 27 '23 at 15:07
  • Moving it to https://unix.stackexchange.com/q/755052/56851 – fguillen Aug 27 '23 at 15:12

0 Answers0