Questions tagged [fdisk]

fdisk was a command-line disk partitioning tool in Linux and old versions of Windows/MS-DOS. It is deprecated on Linux by its inability to handle GPT disks. New systems should use diskpart (Windows) or parted (Linux) to partition disks.

fdisk was a command-line disk partitioning tool in Linux and old versions of Windows/MS-DOS. It is deprecated on Linux by its inability to handle GPT disks. New systems should use diskpart (Windows) or parted (Linux) to partition disks.

148 questions
83
votes
15 answers

Reread partition table without rebooting?

Sometimes, when resizing or otherwise mucking about with partitions on a disk, cfdisk will say: Wrote partition table, but re-read table failed. Reboot to update table. (This also happens with other partitioning tools, so I'm thinking this is a…
Teddy
  • 5,134
  • 1
  • 22
  • 27
60
votes
9 answers

Deleting All Partitions From the Command Line

How do you delete all partitions on a device from the command line on Linux (specifically Ubuntu)? I tried looking at fdisk, but it presents an interactive prompt. I'm looking for a single command, which I can give a device path (e.g. /dev/sda) and…
Cerin
  • 3,497
  • 17
  • 57
  • 72
18
votes
5 answers

How to reset a Harddisk (delete Mbr & delete Partitions) from the Command Line with a script without rebooting?

To start from a clean state I need to reset the hard disk to an empty state from command line. It is not about running a wipe utility, the data don't have to be overwritten. This question is quite similar to Deleting All Partitions From the Command…
c33s
  • 1,465
  • 3
  • 20
  • 39
11
votes
5 answers

Resizing partition fdisk fails with invalid argument

I recently resized a VPS from a 50GB SSD to a 300GB SSD through my hoster's control panel. I now am trying to resize my main partition with fdisk to be able to use all the new space. However, fdisk gives me a warning upon starting: GPT PMBR size…
Bart Pelle
  • 411
  • 1
  • 3
  • 7
11
votes
2 answers

using fdisk: show size in a unit such as MB or GB

doing a fdisk -l is a quite convenient command, but how to make fidsk print the partition size in a unit such as MB or GB?
Andrew Tobey
  • 253
  • 1
  • 2
  • 7
11
votes
1 answer

What is the difference between the Linux and Linux LVM partition type?

Fdisk shows multiple partition types. What is the difference between choosing 83) Linux and 8e) Linux LVM? Choosing 83) Linux also works fine for using LVM, even creating a physical volume on /dev/sdb without a partition table works. Does picking a…
ujjain
  • 3,963
  • 15
  • 50
  • 88
11
votes
2 answers

Non-interactively create one partition with all available disk size

This is disgusting to me, but it works: echo -e "n\np\n1\n\n\nt\nc\na\n1\nw" | fdisk /dev/sdb I would like to know a more prudent or elegant way to accomplish this. The entire boot record and partition table is being zeroed prior to this task, so…
andyortlieb
  • 1,052
  • 1
  • 12
  • 25
10
votes
2 answers

After hardware RAID array expansion fdisk wont allow me to use additional available sectors

We have a large ~18TB hardware raid array on a Dell R720xd. Currently the RAID5 array consists of 6x4TB and I needed to extend it. Step 1 expand the hardware raid array. Simple enough if you have the dell admin tools installed. omconfig storage…
Vagnerr
  • 1,265
  • 1
  • 15
  • 20
10
votes
6 answers

fdisk - partition in single line

Can you create a partition in a usb disk using fdisk command in a single line. fdisk command is interactive in nature, But I want to automate partition creation in a single line using fdisk command.
kumar
  • 423
  • 2
  • 9
  • 23
9
votes
3 answers

e2label Bad magic number in super-block?

This is the output of fdisk: [root@ns1 ~]# fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id …
User
  • 277
  • 1
  • 3
  • 9
8
votes
2 answers

Is the fdisk partition type important when using lvm

I have inherited a few LVM volumes and I noticed that fdisk reports the disks that make up the volume group as partition type 83 (Linux) and not 8e (Linux LVM). Is this a problem and how important are the fdisk partion types? Do they affect…
jwinders
  • 125
  • 1
  • 9
8
votes
2 answers

df showing wrong disk size

Df -h is showing a wrong empty space on my server, for one of the disks: /dev/sda2 450G 393G 34G 93% / Cpanel shows that it has only 34GB free, but there is a lot more. A few minutes ago, I removed over 80GB of log files. So, I'm…
valter
  • 689
  • 5
  • 13
  • 23
7
votes
2 answers

I used "dd" to clone a drive to a larger drive. How can I leverage the additional space (linux)?

Fdisk can't see extra space I upgraded my trusty 74gb Raptor hard drive to a 600gb Velociraptor behemoth. I used "dd" to clone the drive, (i.e. "dd if=old-drive-device of="new-drive-device), swapped the hard drives, booted, etc. Everything works…
user50460
  • 315
  • 1
  • 2
  • 8
6
votes
1 answer

Merge Logical Volume groups

I want to increase root LVM volume space. Is it possible to merge LogVol01 to LogVol00? My LVM setup looks like this: [root@server~]# lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert LogVol00 VolGroup00 -wi-ao…
guest210391
  • 63
  • 1
  • 4
6
votes
2 answers

How can I set the disk partition alignment using linux tools?

After reading Disk Partition Alignment Best Practices for SQL Server, I just want to give those advices a try, but on my linux test server. What are the required parameters in order to set the partition offset (for fdisk if possible, or any other…
alexandrul
  • 1,435
  • 2
  • 19
  • 25
1
2 3
9 10