Questions tagged [fdisk]

fdisk (for "fixed disk") is a command-line utility that provides disk partitioning functions.

Filter by
Sorted by
Tagged with
9
votes
1answer
315 views

Why is the total number of hard disk sectors shown in fdisk not the same as theoretical calculation?

When we use fdisk to check a hard disk, it would show something like: Disk /dev/sda/: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors But when we ...
21
votes
2answers
51k views

How can I use fdisk to create a ntfs partition on /dev/sdx?

I would like to know how to create a ntfs partition on /dev/sdx. I could not figure out if I should use partition type 7 86 or 87. What is the full list of commands to use?
3
votes
2answers
1k views

How can I merge 2 disk images into one with 2 partitions?

I have 2 (relatively small) disk images for qemu (raw format) containing different filesystems (say fat and ext4). I want to put them into an usb stick as two different partitions so that I can plug ...
0
votes
0answers
23 views

USB stick with hidden capacity?

While using dd on my USB drive, the USB drive accidentally got unplugged. The max capacity is 8GB, and 5GB had been written to it. Now, when I try to reformat the USB drive or even remove all ...
2
votes
0answers
59 views

Two Partitions had same starting and ending sectors? How is it possible?

When I was practicing with fdisk, unfortunately, two partitions added with same start and end sectors. When I mount them individually I can see the same data on both partitions. Is it a flaw in fdisk? ...
0
votes
1answer
61 views

Partition #3 contains a ext4 signature

When i use fdisk to create a new partition i get an error which says Partition #3 contains a ext4 signature Do you want to remove the signature? [Y]es/[N]o: This error is not a problem but i am ...
0
votes
0answers
24 views

Why does fdisk sometimes ask what kind of partition to make and sometimes not?

Today I was trying to write a script for partitioning disks using fdisk (since that seemed like the simplest option). When going through fdisk the first time and pressing n for new partition, the ...
1
vote
1answer
26 views

Output fdisk bash command to multiline variable

I can't seem to figure out how I can put a fdisk command from a bash script in a multiline variable. Here is my code hdds="$(sudo fdisk -l | grep "Disk /dev/sd" | awk '{print$2}' | sed 's/://g')" ...
1
vote
2answers
33 views

Mapping between EC2 volume and your mounted filesystem

I am running out of space on a particular filesystem. I know this with the following command df -H $ sudo df -H Filesystem Size Used Avail Use% Mounted on udev 4.1G ...
1
vote
2answers
3k views

Make parted start next partition after previous one - automatically?

I've inherited a shell script that pipes a list of 'random' characters to fdisk. What it is doing is partitioning a disk as follows: Set up the blank disk, partition table etc Create first partition ...
0
votes
0answers
31 views

Extended partition size using fdisk

I want to create on my disk this table partition using the command fdisk. SWAP 10MB FAT32 25MB FAT32 15MB Linux 20MB FAT32 20MB I'm facing a problem: I know I can have only 4 primary ...
0
votes
3answers
33 views

USB-attached HDD visible in dmesg, but can't be opened with fdisk

I've attached a SATA to my computer via a "plugable" (that's the company name) disk docking station. The docking station is fine, since I've attached another HDD and was able to see its partitions' ...
7
votes
3answers
368 views

How can a disk without a partition be “partitioned” without losing data?

I have a 1TB portable hard drive that I use for backups. The entire drive (/dev/sdb) has been formatted as an ext4 filesystem. I have been reading about the benefits of btrfs for backups (checksums, ...
5
votes
6answers
26k views

Re-reading the partition table failed with error 16: Device or resource busy

When re-partitioning the USB drive on CentOS 6.x getting following error. Disk /dev/sdb: 31.5 GB, 31466323968 bytes 255 heads, 63 sectors/track, 3825 cylinders Units = cylinders of 16065 * 512 = ...
0
votes
1answer
21 views

Partition not showing up after Luks decryption

Everytime i decrypt my luks drive the partition is not showing up: cryptsetup -v luksOpen /dev/md0 md0_crypt lsblk sdb 8:16 0 3,7T 0 disk └─sdb1 ...
0
votes
2answers
848 views

Formatting USB stick with fdisk - negative used space?

I formatted a USB drive using fdisk, and created three partitions. Everything seems to work fine, but Disk Utility is showing a negative amount of used space for all partitions: Partition | Capacity ...
-1
votes
1answer
13 views

creating space for data with fdisk

I am running a debian server on Windows in Hyper-V, I have expanded the Hyper-V partition to 2T, now I would like to expand the Debian partition to use that new space. The new space will be for videos,...
0
votes
1answer
1k views

How to check integrity to HDD with UDF format

I'm having problem with a USB external drive, which seem to be formatted with UDF and was being used for MAC and Windows (or at least that is what told). When I attached the HDD to my Linux system ...
5
votes
2answers
1k views

How do I make use of unused space on my boot drive on FreeBSD

I have an old FreeBSD Server (running 7.3-RELEASE) that desperately needs additional storage. In fact, it has some-- the original 20G SCSI drives have been replaced by 300G SCSI drives, so in theory ...
2
votes
3answers
847 views

Usb size wrong after dd write of a ISO-Image

I have just used dd to place the Kali Linux ISO file onto my USB. I then tried to install Kali Linux via the USB, but I couldn't since the install-image was corrupt. I booted back into my other Linux ...
3
votes
2answers
4k views

Can i list unmounted drives without fdisk or lsblk?

I have an Inteno dg200 Router running some Iopsys linux version (kernel 3.14 or so, I believe) I've had some trouble getting a fileshare running using the USB ports and my external harddrive. The ...
4
votes
1answer
2k views

Can't restore/reformat my USB flash drive after moving to GPT

I have 8GB flash memory stick. Sometimes ago I formatted it to be able to install Windows from it. I can't remember what exactly I did but I think I wanted to be able to install Win 7 64-bit to boot ...
2
votes
1answer
2k views

fdisk warning message: (Extended) Partition does not start on physical sector boundary

When I run fdisk, I get a warning message: Partition table entries are not in disk order Here is an example of the command I'm executing and its output: sudo fdisk -l [sudo] password for phil: ...
0
votes
0answers
27 views

Partition Start and End Calculation

I was using the parted command and i was trying to create a new partition using the mkpart option. While i was doing this it asked for the partition start and end. Now i believe i know what the ...
26
votes
4answers
110k views

mount: wrong fs type, bad option, bad superblock

I added a new hard drive (/dev/sdb) to Ubuntu Server 16, ran parted /dev/sdb mklabel gpt and sudo parted /dev/sdb mkpart primary ext4 0G 1074GB. All went fine. Then I tried to mount the drive mkdir /...
1
vote
2answers
3k views

FDISK doesn't show any partitions for a disk, trying to resize an LVM disk, running CentOS

This particular system is acting peculiar and i've not seen this before. System is running CentOS and is a VM on VMWare. I increased the space on the drive from 100GB to 130GB. When I went in to the ...
3
votes
1answer
3k views

Create Logical Volume with non-LVM partition

I have seen everywhere it is mentioned to create a partition of type LVM (8e) and then create logical volume with lvcreate. My question is, what if I create logical volume using lvcreate with non-...
0
votes
2answers
63 views

linux partition/disk numbers (sda1,sda2,sda5)

at the moment i understand that linux has a partition numbering system which is: partitions 1-4 are primary partitions 5 and above and logical but what about extended partitions? my curret ...
2
votes
2answers
7k views

Error when creating new partition on /dev/sda, “No free sectors available”

I have a VirtualBox Linux Guest (Oracle Enterprise Linux 6) and I recently expanded hard drive from 50Gb to 100Gb and then used GParted to resize to use the newly added 50GB (as this was unallocated). ...
1
vote
1answer
34 views

How to enlarge this partition?

Inside vmware ESXI I have a CentOS virtual machine, and I resized the virtual disk from around 30 GB to 120 GB using vmware "edit" vm menu. Then I booted using a gparted bootable ISO and resized the ...
6
votes
1answer
633 views

How to calculate partition Start End Sector?

I am wondering what Start and End value to choose when partitioning my ext. SSD using fdisk. fdisk suggests 2048-250069679, default 2048 but 250069679 cannot be divided by 512 nor by 2048. Wouldn't ...
3
votes
1answer
899 views

Debian Wheezy live - gparted, dmsg, fdisk etc. do not detect local hard drive but it is shown during installation

Yesterday I finished backing up my data and it was time to wipe that HDD of mine for good and freshly install Debian Wheezy stable with Xfce as a WM. I've booted into a live session to see if things ...
3
votes
1answer
403 views

USB flash-drive with hard-coded partition

I have a Kingston DataTraveler 2.0 16GB USB flash-drive: The weird part with this USB flash-drive is that despite the fact that I have zero-filled the flash-drive: # dd if=/dev/zero of=/dev/sdc bs=...
2
votes
1answer
4k views

Is fdisk needed with lvm?

Most documentations about LVM have roughly these steps: fdisk /dev/sdb pvcreate /dev/sdb1 vgcreate fileserver /dev/sdb1 lvcreate --name share --size 40G fileserver mkfs.ext4 /dev/fileserver/share In ...
0
votes
1answer
263 views

How to change partition type id without formatting?

How to change my partition type id from 83 to 8e without formatting and losing data?
2
votes
1answer
1k views

Extending VG > LVM

I want to run an idea by you... I have an Ubuntu 16.04.3 with an LVM on a second drive I would like to extend. I want to complete this only using this CLI, no GUI. I have put my steps below how I ...
0
votes
1answer
222 views

Add PARTUUID to DOS MBR

I have an MBR style formatted SD card where I need a PARTUUID in order to mount a partition there as the rootfs (via linux kernel parameter root=PARTUUID=...). Using an fs UUID does not work. ...
0
votes
1answer
114 views

why are DATA partitions not consistently reported in CentOS 7?

Why am I getting inconsistent/conflicting pictures of the DATA partitions that were created in the CentOS 7 installation process when I use df -T -h, parted ... print, and fdisk -l? In case it ...
0
votes
1answer
64 views

connected old scsi disk via IDE->USB adapter, recognized in syslog but not fdisk?

I have an old hard disk I'm trying to check for data and format before recycling/donating. I'm using an IDE to USB adapter to connect the disk to my linux laptop. In my syslog I see the following ...
0
votes
1answer
227 views

fdisk shows “No free sectors available” while there is enough space

I have a 3.5T ssd, and I have made a 1.5T partition in it before. Then I want to add another partition. But it always shows there is no free sectors left which I think is pretty weird. # fdisk /dev/...
2
votes
1answer
2k views

Growing my extended partition to the left

I have the following one hdd Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Disk identifier: 0xfa6bd800 Device Boot Start ...
1
vote
1answer
5k views

Paritioning a SD Card with both Linux and Fat32 partitions

On a Raspberry Pi with the raspbian distro i need to make an extra partition that can be read from both windows and linux. So i use FDISK on /dev/mmcblk0 (the sd card) to create a new partition ...
1
vote
1answer
12k views

can't see disk partition /dev/sdb in linux

I did a successful partition for a new volume /dev/sdb. After that I mounted it in /etc/fstab. The thing is that I can't see /dev/sdb volumes along with /dev/sda volumes using df -h command nor with ...
0
votes
0answers
37 views

Disk space disappeared [duplicate]

cd / && du -sh . told me that the filesystem used 2.1G spaces of disk: root@ubuntu:/# cd / && du -sh . du: cannot access './proc/3874/task/3874/fd/3': No such file or directory du: ...
-1
votes
1answer
1k views

Resize partition with fdisk without data loss

I need to increase the partition using the empty space located before the partition starts without data loss. As far as I know to resize the partition and to leave data intact one should start the new ...
1
vote
1answer
61 views

How to change zram sector size?

I have cloned a disk into a sparse file that is about 80G but indeed requires only about 12G, even not compressed it fits on my memory, but in order to save some resources I want to use zram: sudo ...
0
votes
3answers
244 views

How to check if partition is Extended/Primary in Linux

Below is the info I get using (g)parted or fdisk command. Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 196265983 196263936 93.6G 83 Linux /dev/sda2 ...
1
vote
2answers
4k views

How to resize logical volume to fit filesystem

How can I resize logical volume to fit filesystem automagically?
23
votes
4answers
53k views

Finding the sector size of a partition

I answered this question, assuming that the *.img file had a sector size of 512. How do I query a device, or the image of a device, to find the correct sector size?
0
votes
0answers
36 views

After installing Windows 10 LTSC on a separate intenal HD, the Linux portion of my “fdisk -l” output has a column it didn't have prior

I have two harddrives in this computer—one is a regular SSD, the other is an M2 SSD. I installed Arch on the regular one and, after a little over a week of having it, installed Windows 10 LTSC on the ...