No free sectors available shown by fdisk in centos 7 minimal

General support questions
Post Reply
Brief-Wishbone9091
Posts: 10
Joined: 2023/04/13 05:19:13

No free sectors available shown by fdisk in centos 7 minimal

Post by Brief-Wishbone9091 » 2023/05/01 08:45:55

This is the output of fdisk /dev/sdb

[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.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 (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2): 2
No free sectors available

This is the output of fdisk -l:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d312d

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 83886079 40893440 8e Linux LVM

Disk /dev/sdb: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xcb3d9031

Device Boot Start End Blocks Id System
/dev/sdb1 2048 4194303 2096128 83 Linux

Disk /dev/mapper/centos-root: 39.7 GB, 39720058880 bytes, 77578240 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by tunk » 2023/05/01 09:52:06

Looks like you have used all for sdb1: 4194303*512 = 2147483136

Brief-Wishbone9091
Posts: 10
Joined: 2023/04/13 05:19:13

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by Brief-Wishbone9091 » 2023/05/01 10:08:44

What's the fix to this?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by TrevorH » 2023/05/01 11:16:31

There is no "fix". You have already got a partition on /dev/sdb that is occupying the entire disk. You can't create another one because it's full. So you first need to find out what that existing partition is and work out if it contains any data that you want. If it does then you need to back that up. If it doesn't then you can do what you want to it - including deleting it and making a new one or formatting the current one.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by tunk » 2023/05/01 13:14:43

Never used logical volumes, but the name and size of
/dev/mapper/centos-swap suggests that it's configured
as swap. You could run the "free" command to see how
big swap is.

Don't know how /dev/sdb1 and /dev/mapper/centos-swap
is related, but this may shed some light:
https://www.linuxquestions.org/question ... 175582538/

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by TrevorH » 2023/05/01 13:18:49

The sizes of /dev/sda1 + the two LVM LVs in the 'centos' VG add up to the size of /dev/sda. It would appear that nothing is using /dev/sdb but the disk may have data on it that is not currently in use.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by jlehtone » 2023/05/01 15:40:54

What does the 'fdisk' say if the disk has GPT with "protective MBR"?
I would look at the disks with 'gdisk' too, and also the output of 'lsblk'.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by TrevorH » 2023/05/01 16:02:59

All the GPT labelled disks that I've seen show a dummy partition in fdisk of type 'ee' not '83' like this one.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: No free sectors available shown by fdisk in centos 7 minimal

Post by Whoever » 2023/05/02 05:08:53

Is this a VM? The drives appear to be very small, so I assume they are virtual drives. If so, you should be able to extend the size of the drives on the host.

the command "lsblk" is probably more informative, also "vgdisplay" and "pvdisplay".

Post Reply