FDISK - no sectors available

General support questions
Post Reply
bencp
Posts: 30
Joined: 2018/09/20 18:30:00

FDISK - no sectors available

Post by bencp » 2018/09/24 16:12:35

Hey all , i try to practice on create partition on cent os , and i got an error when i tried to create a partition on /dev/sda
here is the commands :

-------------------------------------------------------------------------------------
[root@localhost ~]# fdisk /dev/sda
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 (3 primary, 0 extended, 1 free)
e extended
Select (default e): p
Selected partition 4
No free sectors available

-------------------------------------------------------------------------------------


Here is the disk information -

-------------------------------------------------------------------------------------
Command (m for help): p

Disk /dev/sda: 64.4 GB, 64424509440 bytes, 125829120 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: 0x000273c6

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 616447 307200 83 Linux
/dev/sda2 616448 8744959 4064256 82 Linux swap / Solaris
/dev/sda3 8744960 125829119 58542080 83 Linux

-------------------------------------------------------------------------------------

What is this error mean ?
Do i need to add another hard disk to create partition on it ? (im on vm)

thanks all !

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

Re: FDISK - no sectors available

Post by tunk » 2018/09/24 17:16:25

There's no free space on your disk:
It has 125829120 sectors and the end sector of your third partition is 125829119.

bencp
Posts: 30
Joined: 2018/09/20 18:30:00

Re: FDISK - no sectors available

Post by bencp » 2018/09/24 17:19:54

tunk wrote:
2018/09/24 17:16:25
There's no free space on your disk:
It has 125829120 sectors and the end sector of your third partition is 125829119.
Read something about that. so , which partition should i resize that it will not affect the boot process / file system ?
sda 3? how can i resize it with fdisk and not parted tool?

thanks

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

Re: FDISK - no sectors available

Post by TrevorH » 2018/09/24 17:25:11

What are you really trying to do?

Your disk currently has 3 partitions on it. 1: is probably /boot, 2: is your swap space and 3: is everything else, most likely mounted as /. Why do you need to create a new 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

bencp
Posts: 30
Joined: 2018/09/20 18:30:00

Re: FDISK - no sectors available

Post by bencp » 2018/09/24 17:28:38

TrevorH wrote:
2018/09/24 17:25:11
What are you really trying to do?

Your disk currently has 3 partitions on it. 1: is probably /boot, 2: is your swap space and 3: is everything else, most likely mounted as /. Why do you need to create a new one?
Well nothing , just try to get some practice on partition.
I added another HD on the VM and successfully created partition + swap partition
but how i can resize the /dev/sda3 ?
just for practice i want to create /dev/sda4 .

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

Re: FDISK - no sectors available

Post by TrevorH » 2018/09/24 17:47:43

Since /dev/sda3 is most likely your / filesystem, the answer is "not easily". You cannot shrink a mounted filesystem of any type. You cannot shrink an xfs filesystem at all, ever. If your / is an ext3 or 4 filesystem then it can be shrunk but you have to do that while it's not mounted which, in your case, means rebooting from some other media (the install media perhaps) and doing so from there.
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

Post Reply