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.

learn more… | top users | synonyms

23
votes
6answers
13k views

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 ...
4
votes
4answers
2k views

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, ...
4
votes
2answers
10k views

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 ...
4
votes
1answer
126 views

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 ...
4
votes
2answers
797 views

Repurposed disk - Linux blkid command returns incorrect information

I'm working with an SSD drive removed from a VMWare ESXi installation. I'm trying to reuse the disk in an existing Linux installation (CentOS 6.2). The drive sits behind an HP Smart Array P410 RAID ...
3
votes
2answers
2k views

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 ...
3
votes
5answers
7k views

how do you mount and format /dev/sda to a different /dev/ name?

We have linux box running fedora. It has a small laptop hard drive running the OS and a 3ware RAID controller running 3 SATA drives RAID 5. When we boot the computer and login, I run “fdisk –l” ...
3
votes
2answers
1k views

Cannot mount /dev/sdc1 on Debian 5.0, special device /dev/sdc1 doesn't exist

I'm trying to fix an odd problem I'm having that I've never seen or heard of before. I have a disk, /dev/sdc and I'm trying to mount it, but cannot. sudo mount /dev/sdc1 /mnt mount: you must ...
2
votes
1answer
470 views

Where did the free space go?

I have installed CentOS 5.7 64 Bits in my server which has 4x300 GB SAS drives on hardware RAID 10. At the installation, I chose default partitions. Here are the commands output: [root@server ~]# ...
2
votes
2answers
783 views

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 ...
2
votes
3answers
136 views

Aligned partitioning of 2TB disk with Linux fdisk

Is there a way to create a single 2TB partition, which is 4096-byte-sector aligned, on a disk using the standard Linux fdisk (I have tried version 2.17.2)? I've tried the following things and ran ...
2
votes
1answer
47 views

Replacement raid1 drive is one block smaller. What to do?

Apparently once should always leave a bit of empty space at the end of each raid1 partition. But if we're too late for that, what can be done if a replacement RAID1 drive is slightly smaller than the ...
2
votes
1answer
797 views

Adding Extra Hard Drives Debian Fdisk

well I just got a new server and it's a little different than what I'm use to, when I run cfdisk I get WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. ...
2
votes
1answer
1k views

How can I change a partition mount to var and still boot up?

My first question here on server fault. In my haste, I set up a local server with Centos 6.2 and let the Centos installer handle the partitions. Big mistake, I know. Anyway, the only problem I have ...
2
votes
1answer
688 views

swapping out a faulty drive in a raid array with a new one… but WD changed the block size?

I got a brand new (same model) WD Caviar Green drive to replace the faulty one in my 5x2TB Raid 5 array. However, the new disk appears to be slightly different. According to the internet, Western ...
2
votes
2answers
258 views

same harddrive on the same controller, but different cylinder/head/sector

I have a pair of identical SATA harddrives connected to the same controller, but for some reason, fdisk under Debian 6 reports different CHS: user@host:~$ sudo fdisk -l /dev/sdc Disk /dev/sdc: ...
2
votes
3answers
832 views

Recover partition table for lvm

I managed to run fdisk on the wrong disk. However I was able to save a log of the terminal session. Fdisk before the accident: ~$ sudo fdisk -l /dev/sda Disk /dev/sda: 320.1 GB, 320072933376 bytes ...
2
votes
1answer
573 views

Fedora 17 - Dropping into debug shell after attempted partitioning

So I tried creating a new partition on Fedora 17 using fdisk as follows: Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder ...
1
vote
3answers
113 views

which drive do I mount

I have a system hdd then two raid1 hard drives I see that sda1 is the system drive but when i do a fdisk -l I get the following results so which of the following do i need to mount to get the ...
1
vote
3answers
170 views

One all-enclosing partition or just use the entire device?

I received a 1TB hard drive that had a single 1TB partition. Because we do not need partitions on the drive (and I disliked using the path /dev/sdc1 instead of /dev/sdc), I went to fdisk, deleted the ...
1
vote
3answers
323 views

Extending hard disk size after hard drive regrow without losing data

I wonder if this is possible to extend or regrow the Linux hard disk partition from 8 GB to 20 GB without losing the existing data on the partition ? at the moment this Ubuntu Linux is deployed on ...
1
vote
3answers
235 views

Cannot allocate additional space after growing RAID array

I added three new drives to a Dell 2950 (running RHEL 5) with a PERC 6/i storage controller. The machine was previously running RAID 1 on two drives + hotswap. Rather than create an identical RAID 1 ...
1
vote
2answers
336 views

What's the quickest way to format a drive (USB, HDD, Floppy) under Linux?

I had fdisk segfault and just wondered if anyone had any other options? EDIT: It was late and that was a dumb question. Good answer though!
1
vote
1answer
744 views

How to increase my `/` of Fedora installed on a virtual box?

I used virtualbox4 to create a box(8G disk) and installed a Fedora 16. Soon I found the space is not enough that I can't download anything in ~/download. I use VBoxManage to increase the disk size to ...
1
vote
2answers
293 views

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 ...
1
vote
1answer
63 views

Mount file systems from complete disk image with several partitions and logical volumes

I have a complete disk image (dd if=/dev/sda of=foo.bin) that contains several partitions and LVM logical volumes on which there are ext4 filesystems. How do I mount one of the filesystems on this ...
1
vote
3answers
540 views

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.
1
vote
1answer
43 views

How do I rebuild my software RAID 1 array after a drive replacement

So I have 1and1 dedicated host with RAID 1 setup. One of the drive went bad, and they had just replaced it with a good one. Now I need to the build, but I'm not sure which drive is the old one, and ...
1
vote
1answer
46 views

aligning partition boundaries of already installed system

I have qemu raw disk which includes two partitions. The second partition is not aligned according to ssd principles. I will move this into Smartcloud environment and they suggest aligning according to ...
1
vote
2answers
299 views

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 ...
1
vote
1answer
201 views

How do you get iSCSI multipath to discover new LUNs that have not been partitioned yet?

Oracle Linux 6.3 iscsi multipath shows LUNs with existing file system but not the raw block devices that have not been partitioned yet. When I run multipath -ll it will show a LUN that has previously ...
1
vote
1answer
554 views

Whats wrong with my partition table?

I'm a bit lost here. I got my trusty old external 500Gb USB drive but it refuse to mount: I think my partition table is invalid: sudo fdisk -lu /dev/sdb Disk /dev/sdb: 500.1 GB, 500107862016 bytes ...
1
vote
1answer
263 views

how to sync/flush after fdisk in linux (busybox)

when I change the partition table in Linux (busybox) and exit fdisk I'm still able to mount the old partitions, until I perform a reboot for example a) system is setup and has a /dev/sda1 and ...
1
vote
2answers
562 views

Partition size inconsistency after dd clone

We have recently upgraded a system HDD - it was 160GB, now 2TB. We upgraded as we were running low on space, mainly on /usr, and also on /home. I prepared the new drive with a Live CD and GParted ...
1
vote
1answer
406 views

Generate a new Volume ID in Linux

Sparing most details/reasons, I have a situation in which I'm cloning drives for mass production. Some of them are being installed in servers that only need one disk (in that case this is a ...
1
vote
1answer
65 views

OpenBSD - Image on a new, bigger disk - how to use the extra space

Our present OpenBSD server needed more disk space, so we replaced the 13 GB disk (it's pretty old too) with 150GB. An image was made and then restored on the new disk. So far, so good. The new disk ...
1
vote
1answer
85 views

fdisk -l only displays boot partition

I have a SAN, and it's able to read and write to the 50TB RAID just fine, but when I run fdisk -l it only lists the boot partition of the SAN server, and doesn't display anything about the other ...
0
votes
4answers
2k views

Can you change the partition type on a linux server without starting up fdisk?

I'm looking for a way to change a partition type on a linux system without starting fdisk. (In this particular case from "linux" to "softwareRAID") The ultimate goal here is a script that is going ...
0
votes
2answers
28 views

Scripted partition creation

I need to routinely do these steps on various machines that have the same hardware: delete any partitions on /dev/sda create a 100G primary partition on /dev/sda change partition type of created ...
0
votes
1answer
44 views

Error: partition length of 6442450944 sectors exceeds the loop-partition-table-imposed maximum of 4294967295

I'm trying to create a partition on a RHEL 6.3 machine, but parted is giving me the following error: $ sudo parted /dev/vdb mkpart logical 1 Error: partition length of 6442450944 sectors exceeds the ...
0
votes
2answers
95 views

how to mount additional space to existing partition?

This is the original output of 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 ...
0
votes
1answer
155 views

Partition Centos | Raid

I have 4 HDD, the system is installed on /dev/sda2 # df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 884G 2.1G 836G 1% / /dev/sda3 2.0G 159M 1.7G ...
0
votes
2answers
179 views

Ubuntu: How to find unallocated partition/free space?

I've a legacy dedicated server with Ubuntu onboard (console mode only). Based on docs (prices etc.) I see that server must have 250+ GB, but I see significantly less: $ df -h Filesystem ...
0
votes
3answers
64 views

How to view if partitions primary or secondary in Linux

How do I view my partitions if they are primary or secondary in Linux CentOS? I tried df -T but it does not show if partitions are primary or secondary. Thanks.
0
votes
1answer
394 views

sfdisk - partition creation problem

I'm trying to create disk image with 2 partitions: First partition: 1Mb for boot and second partition of the maximum capacity dd if=/dev/zero of=flash.img bs=1M count=10 /sbin/sfdisk flash.img ...
0
votes
1answer
131 views

Linux partitioning problem

I am using cfdisk to repartition my hdd as from OS install I only got 1 big partition a swap. I wanted to resize the big partition to 1 GB /boot and use the rest of the space for an extended ...
0
votes
0answers
37 views

why cant I set the correct partition size in fdisk

I am currently attempting to setup a raid array. At this point in time I am setting up partitions of the same size on each hard drive that I would like to use in the array, although when I used fdisk ...
0
votes
0answers
30 views

Disks not found by “fdisk -l” when using udev rules [closed]

If I have a cleanly installed linux system and do a "fdisk -l" I see the 2 harddrives installed in the server. However, if I set a custom udev rule to map one of the harddrives to a certain path, ...
0
votes
0answers
161 views

Ubuntu Server - Screwed up partition table?

So I think I've screwed my Ubuntu server after using PING (it's a tool like Norton Ghost) to try and create a backup image. Basically the system got to an unbootable state just with the grub ...
0
votes
0answers
101 views

create new partition with custom sectors in shell/fdisk on ubuntu

i want to create a new partition with all free space. here the detail info: Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors Units = ...

1 2