Questions tagged [fdisk]

fdisk is a utility present in many operating systems that perform partitioning on hard drives. There are versions of fdisk for Linux, DOS, Windows, FreeDOS and OS / 2. It handles DOS FAT partitions only.

Filter by
Sorted by
Tagged with
0 votes
0 answers
44 views

Broken Partition table

So I have a ssd disk and somehow the GPT partition table got removed. From that moment, when I plug disk in, disk is still connected (image below) but when I try to access it through diskpart, it's ...
0 votes
0 answers
32 views

Micro SD Card reports wrong (too small) size

I wanted to put an old micro SD card back into service. According to the manufacturer it is a 128 GB card. However, FDisk and Parted say it is only 8 GB: Parted: (parted) select /dev/mmcblk0 Warning: ...
  • 103
0 votes
1 answer
9 views

How do I format a pendrive quickly, with a simple one-liner, from command line?

How do I repartition and format a pendrive quickly, with a simple one-liner, from command line? I would like to do something like this: $ format /dev/sdb which would destroy the existing partitions, ...
-1 votes
0 answers
36 views

Create disk partitions with parted on Linux machines by using max disk size to create partitions

here is nice example how to create from disk two partitions ( when disk size 2000GB) first lets verify what is the real disk size parted -l | grep -i disk | grep "/dev/sde" Disk /dev/sde: ...
2 votes
1 answer
352 views

Fdisk outputting seemingly absurd CHS values

Take the following fdisk input: o # Create DOS/MBR partition table. n # Create new partition. p # Partition type 1 # Partition ID 2048 # Starting sector +4M # Ending sector t # Assign ...
0 votes
0 answers
29 views

fdisk -l + why fdisk show diff size from real disk size [duplicate]

fdisk -l show the following os disk size fdisk -l Disk /dev/sda: 247.0 GB, 246960619520 bytes, 482344960 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / ...
0 votes
0 answers
729 views

fdisk - Hex codes list - which ones are NTFS or FAT 32 among the below list?

Is it possible to assist me finding fat32 or ntfs codes among the below list? Command (m for help): t Selected partition 1 Hex code (type L to list all codes): L 1 EFI System ...
0 votes
0 answers
886 views

linux. extend partition space with unallocated space BEFORE it

I have a dual boot (win + ubuntu). How I can extend the disk space of /dev/nvme0n1p6 (Ubuntu, is a partition of the current OS) with preceding free space? I tried to do it with GParted but the right ...
0 votes
0 answers
103 views

Extending disk space for HyperV Linux guest

The guest Debian-VM shows a storage in use close to 30GB, which was the amount of disk space I defined when creating the VM. :~$ df -h Filesystem Size Used Avail Use% Mounted on udev ...
0 votes
1 answer
69 views

Cloning a 2 TB disk with dos label to a 4 TB one with gpt label

Hello everybody out there using Linux, Cloning disk using dd usually works fine for me, but I ran into troubles when cloning a 2 TB disk to a 4 TB one: the dos label would need to be changed to a gpt ...
0 votes
1 answer
31 views

ubuntu - use a disk without paritioning it?

i added a hard disk to my ubuntu install today. i previously had 2 hard disks. i added a 3rd today. The 3rd harddisk is sdc running lsblk it looks like sda 8:0 0 35G 0 disk ├─sda1 8:1 ...
  • 973
0 votes
0 answers
13 views

Mount a detected but not listed in disks list SD card [duplicate]

My problem is a bit complicated to describe knowing that I'm not really a passionate about partitioning, but here's what I'm trying to do, What I tried and what doesn't work : Goal My goal is to ...
  • 1
1 vote
0 answers
454 views

LVM: Problems in adding disk to an existing Logical volume

I have a disk under a Logical Volume. $ lvdisplay --- Logical volume --- LV Path /dev/vg_prod/lv_prod LV Name lv_prod VG Name vg_prod LV UUID ...
0 votes
1 answer
161 views

linux + how to extend sdd1 partition based on that sdd disk have enough space

We have rhel server 7.2 version ( VM machine ) with sdd disk sdd disk have parted partition sdd1 , and our goal is to increase the sdd1 partition to 10g from current 1K size From lsblk sdd ...
0 votes
0 answers
74 views

How to enlargen a specific partition in Centos7 with several partitions

My /home directory quickly runs out of disk space, so I want to expand it from 32GB to 64GB. [me@centos7 ~]$ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 7....
0 votes
0 answers
307 views

Clone/Mirror Proxmox Drive into Another Proxmox Drive that uses GPT

A Proxmox VM (Xpenology DSM) currently has a 4 TB virtual hard disk that has the wrong partition table msdos. Instead, one with GPT should be used (to be able to resize it larger than 2 TB). How can ...
  • 345
1 vote
1 answer
108 views

How come I can't write to the last byte of the the last block?

I was doing some tests by writing random patterns of data at a block size of 512 bytes (the size of blocks on my drive) and dd fails at the last block saying that the device ran out of space. I was ...
  • 13
0 votes
1 answer
193 views

Unable to Mount HDD Removed from NAS & Connected to Ubuntu via USB-SATA Adapter

I am trying to access data from a 8TB HDD that is removed from a non-functining QNAP NAS device. The HDD is connected to an Ubuntu 20.04 machine using a USB3-SATA adapter. When the HDD is connected to ...
  • 345
0 votes
0 answers
35 views

Is this USB flash disk dead ? Can't write and reads only zeroes [NOT DUPLICATE - READ IN FULL] [duplicate]

This is an old flash disk that I have not used in a while. It was a small drive I was planning to use for TinyCore Linux. I plug it in, and it does not show up in KDE Partition Manager. I query lsblk, ...
  • 87
0 votes
1 answer
218 views

Does HP Proliant ML110 Gen9 Support SAS DISK

so i did Buy Proliant ML110 Gen 9 That have Dynamic Smart Array B140i Raid with inside in the first look the Server has 4 Disk port in the front that can connect to SAS Disk so i did buy 2 SAS disk ...
1 vote
1 answer
237 views

How to wipe Chrome OS partition from Dual Booted Acer c720

Ok, I have a dualbooted Acer c720, with Chrome OS and Gallium OS. Gallium OS supports steam. I have been able to use blender on the Gallium OS partition. However, I want more space for projects. Is ...
0 votes
1 answer
716 views

Resized Windows partition (using cfdisk) is treated as RAW by Windows

In an attempt to make room for my Linux installation, I did the following: Booted using a live Linux USB Used cfdisk to Resize the Windows partition Selected Write to save the new partition size ...
  • 155
0 votes
1 answer
234 views

fdisk partition "n megabytes" less than total physical size

Is there a way to use fdisk to define a new partition that is e.g. "100MB less" than the maximum possible size? Background: Due to deviation between nominal disk size and physical disk size, ...
  • 103
0 votes
0 answers
114 views

Can I recover data from deleted hard drive partitions on a Windows 95-98 PC? [duplicate]

I have some old Windows 95-98 era PCs that I would like to recover data from if possible. They have all had the hard drive partitions deleted using 'fdisk' and have not been used since. Would it be ...
0 votes
1 answer
582 views

How can I extend / dev / sda6 is it possible?

I need to extend / dev / sda6 on other occasions and used the following guide (https://www.miarec.com/doc/administration-guide/doc1012), adding a new disk to the vm, but apparently it is not ...
0 votes
0 answers
294 views

/dev/sdc1 not showing under /dev/sdc for my pendrive

I am trying to connect 16 DB kingston data traveller to my Ubuntu machine. This pendrive is not being detected in other machines. Thats why I tried to check it. When I issue a lsblk command, I am ...
0 votes
1 answer
60 views

Does Windows remove files with invalid characters within name during disk repair?

I have some files on external HDD whose names contain ':'. These files work fine on Ubuntu but fail to open in Windows. Recently I tried doing a diskcheck on my external HDD and it poped-up that it ...
0 votes
0 answers
158 views

HDD failure and format error, shows 4.1 GB instead of 1.86 TB

I have a Seagate 2.0 TB HDD. I had Ubuntu installed on it and grub on my SSD. I removed the cable when trying to change it. After that when I plugged it in grub showed the black error screen with grub&...
  • 1
0 votes
1 answer
95 views

How to rescue USB drives?

A dd command on CentOS 7 failed, and now my USB disk (/dev/sdf) cannot be written to. These are the outputs I get: $ lsblk /dev/sdf lsblk: /dev/sdf: not a block device $ lsblk NAME MAJ:MIN ...
0 votes
2 answers
704 views

How to fix fdisk wrong partitions

I'm running dual boot of Linux Mint 19.2 Tina and Windows 10. I wanted to format my usb flash drive but when I open it with fdisk /dev/sdc and then type p i get shown partitions of my computer file ...
  • 3
0 votes
0 answers
29 views

Weird disk behaviour

Today I faced something completely strange. I run Windows 10 on a machine. On this machine I wanted to erase the internal HDD(not C drive) where just some data lays around. I booted into sparky linux ...
  • 105
0 votes
0 answers
62 views

Deleting Files and directories on a Solid State Drive (fdisk, dd, rm)

I have been reading for a while on how rm, fdisk and dd work. I wasn't able to fully understand their source code however. Let's assume I would like to delete my /dev/nvme0n1p3 partition and the files ...
3 votes
3 answers
4k views

increased size of disk in a Virtual machine, but gdisk doesn't want to use the new space

I have a VM with a virtual disk (visible as /dev/sdb) with a size of 10G The admin increased the size of the virtualdisk to 60G. I rebooted the machine and see now, that the disk is bigger. root@...
  • 253
0 votes
0 answers
447 views

Geometry of USB Memory - heads per cylinder is 124

i have a USB Stick, and this stick has some problems, how to set up for it proper geometry TestDisk 7.0, Data Recovery Utility, April 2015 Christophe GRENIER <grenier@cgsecurity.org> http://www....
  • 1
1 vote
0 answers
27 views

Why BlockDeviceMapping does not create UUID?

In Linux machines, block devices have UUID Below is the CloudFormation template: "BlockDeviceMappings": [ { "DeviceName" : "/dev/sdf", "Ebs" : { ...
1 vote
0 answers
136 views

How to create a partition with gdsik without naming it?

I'm currently looking for alternatives to graphical programs for partitioning my hard drive. So I'm searching for an easy command line tool for it. Since my hard drive has a GPT partition table the ...
  • 603
0 votes
1 answer
447 views

Understanding fdisk -l output on a virtual machine

I installed lubuntu on VirtualBox and allocated 10Gb fixed storage. Later, I made a copy of the machine and allocated dynamic storage of 20GB. I checked fdisk to see if it worked, but I don't ...
0 votes
0 answers
588 views

“No valid partition table was found on this device.” + “Error: Can't have a partition outside the disk!” + fdisk reads “7.3T” Size; How do I fix this?

Distro: Netrunner Blackbird (Debian) I/O: Sata to USB cable KDE Parition Editor: "No valid partition table was found on this device." me@computer:~$ sudo parted -l Model: ATA LITEONIT LCT-128 (scsi)...
0 votes
0 answers
15 views

Partition drive at runtime via commandline?

I am currently trying to write a bash script that when executed creates a new partition that is 100mb in size. However, I want to use the free space on /dev/sda1 - the parition on which the system is ...
  • 127
1 vote
1 answer
2k views

Why do Windows and Linux leave 1MiB unused before first partition? [duplicate]

When partitioning from scratch a USB Flash drive (8GB or larger) under Windows (diskpart) or Linux (gparted, fdisk) as Master Boot Record with a single partition, that partition usually starts at byte ...
  • 756
0 votes
1 answer
159 views

Why fdisk adds half kibibyte sometimes?

I'm trying to partition a 1440 KiB floppy disk image using fdisk (util-linux, v2.31.1). However, the tool is seemingly adding a 512-byte sector, no matter what units I use, and I can't tell why. ...
1 vote
3 answers
698 views

3TB Western Digital Hard drive is showing only 2TB

I do not believe this to be an issue with formatting. Both Linux and Windows (64bit) see it as 2TB drive. However it is supposed to be a 3TB drive. It is in an enclosure, and I am wondering if perhaps ...
  • 133
0 votes
0 answers
215 views

Fdisk doesn't recognize Macbook's file system

I need to mirror a MacBook, which was functioning properly. But when I ran fdisk -l, I got this: Disk /dev/sda: 113 GiB, 121332826112 bytes, 236978176 sectors Units: sectors of 1 * 512 = 512 bytes ...
0 votes
1 answer
314 views

How can I recover Linux partition which is mistakenly had fdisk run on it

I have a Ubuntu 18.04 system with two disk (/dev/sda1 /dev/sdb1). /dev/sdb1 is in ext4 format before. Someone ran the following command with default options: fdisk /dev/sdb1 How can I recover this ...
1 vote
2 answers
398 views

Unable to Detect Size of Brand new Hard Disk

I just purchased a 8TB hard drive today. I just put it in my USB enclosure. fdisk -l did see the device: Disk /dev/sdc: 1404.5 GB, 1404493455360 bytes, 2743151280 sectors Units = sectors of 1 * 512 ...
  • 165
1 vote
1 answer
612 views

Extend a PV partition in Linux

I have a situation where there is ~300G available on /dev/sda and I want to extend a partition /dev/sda3 with the additional ~300G. However from what I read online if /dev/sda4 exists, I cannot ...
1 vote
0 answers
695 views

USB Harddrive not working after being bumped during download

I recently bumped my external hard-drive whilst downloading to it, and now my computer seems unable to recognize it. Any help available to help me retrieve the data would be appreciated/worshiped. It ...
2 votes
1 answer
7k views

How do I format an NTFS drive on CentOS 7 so that I can also use it in Windows?

We have a LIDAR system that collects data in the field. The computers that process the raw data are Windows computers so we use NTFS. However, the LIDAR system itself runs CentOS 7. Normally this ...
  • 175
0 votes
1 answer
74 views

Ubuntu detects half of external disk

I have a Virtual Machine that has 3 disks. The third one is 150Go size, I get this with sudo fdisk -l /dev/sdc: /dev/sdc1 2048 314572799 157285376 83 Linux However, df command ...
  • 101
0 votes
1 answer
4k views

Why disk partitions start at sector 2048 [duplicate]

I am learning to use fdisk. When I check free space in disk using F command it shows free space starts at sector 2048. But if i try to create new partition using n command It says I can start from ...
  • 101