Questions tagged [fdisk]

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

481 questions
206
votes
17 answers

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 /mnt/storage2 mount /dev/sdb1 /mnt/storage2 It…
Eli Korvigo
  • 2,183
  • 2
  • 11
  • 7
39
votes
2 answers

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?
user
  • 2,227
  • 6
  • 20
  • 25
37
votes
5 answers

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?
Stefan
  • 24,830
  • 40
  • 98
  • 126
37
votes
1 answer

/dev/mapper in fdisk

After installing CentOS, I see several lines like /dev/mapper/centos_jackpc--11-swap and /dev/mapper/centos_jackpc--11-root when I issue fdisk -l. What is the purpose of these? And why do they not show up for Ubuntu? The full fdisk -l is shown…
Tosh
  • 699
  • 1
  • 6
  • 11
37
votes
7 answers

Change the number of the partition from sda1 to sda2

I have a disk with two partitions: sda1 and sda2. I would like change the number of sda1 to sda2 and sda2 to sda1. It's possible but I don't remember the procedure. i.e. My first partition will be sda2 and the second sda1, so I need to specify a…
Rufo El Magufo
  • 3,186
  • 2
  • 22
  • 35
35
votes
4 answers

fdisk vs parted

I've been running a small media server at home for 10+ years and looking into replacing it (before it breaks). I intend to hook up a new drive to my old system, partition and format (ext4 seems most stable right now) and copy the media over to the…
Ted
  • 353
  • 1
  • 3
  • 4
25
votes
3 answers

How to extend logical & extended partition with fdisk

I'm trying to extend partition /dev/sda5 which is logical partition under extended partition /dev/sda2. I want to use fdisk. Procedure should be to delete both partitions and then to recreate them with exact same starting sectors (1001470 &…
A.D.
  • 920
  • 1
  • 9
  • 22
17
votes
3 answers

Why do we need to specify partition type in fdisk and later again in mkfs?

I'm a little confused about fdisk and mkfs. So - here is typical USB flash drive partitioning and formatting: umount /dev/sdb fdisk fdisk /dev/sdb Command (m for help): d Selected partition 1 Command (m for help): n Command action e extended p …
Stann
  • 2,159
  • 5
  • 23
  • 24
14
votes
2 answers

Will dd if=/dev/zero of=/dev/sda wipe out a pre-existing partition table?

Will # dd if=/dev/zero of=/dev/sda wipe out a pre-existing partition table? Or is it the other way around, i.e, does # fdisk /dev/sda g (for GPT) wipe out the zeros written by /dev/zero?
user223600
14
votes
2 answers

fdisk -l shows ext3 file system as HPFS/NTFS

I have an external HDD which I formatted as NTFS partition in Windows. Now, I formatted this HDD in my linux system using the below command. mkfs.ext3 /dev/sdb1 It was formatted successfully. However, when I run the fdisk -l command, it gives me…
Ramesh
  • 38,687
  • 43
  • 140
  • 215
12
votes
1 answer

How does partprobe work?

I was looking for a way to refresh the scsi bus (or any other bus, for that matter) that would allow my kernel ( 2.6.18-194-el5 on CentOS 5.5) to know about the partitions on a drive, and I couldn't find a way. partprobe did it instantly. How?…
Matt Simmons
  • 1,040
  • 8
  • 14
12
votes
3 answers

Problem mounting GPT disk partition

I am trying to mount a partition on a GPT disk, but I get the following error: $ sudo mount -t ext4 /dev/sda1 disk/ mount: special device /dev/sda1 does not exist Looking at dmesg, I don't see any errors on /dev/sda: $ dmesg | grep sda [ …
Hamza
  • 347
  • 2
  • 6
  • 16
11
votes
1 answer

Why does fdisk prefer 512 byte sector size even when the physical sector size of the block device is 4096?

I have a disk with 4096 byte sectors: # cat /sys/class/block/sda/queue/physical_block_size 4096 # For some reason, fdisk prefers to show the information about the disk using 512 byte sectors: Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168…
Martin
  • 7,284
  • 40
  • 125
  • 208
11
votes
3 answers

dd command indicates not enough disk space - trying to format sd card for raspberry pi

I have been trying to format an sd card with the lastest debian jessie-lite image for use with raspberry pi. When using the dd command, it states that there is no space left on device after copying 10 megs. I have searched SE and have tried to use…
Pura Vida
  • 123
  • 1
  • 1
  • 6
11
votes
1 answer

"fdisk -l" output: what are Disk label type" and "Disk identifier"

fdisk -l output: . . Disk label type: dos Disk identifier: 0x0006a8bd . . What are Disk label type and Disk identifier? Also, apart from the manuals, where else can I find more information about disk management / partitioning etc..?
Lavya
  • 1,545
  • 5
  • 18
  • 26
1
2 3
32 33