Questions tagged [fdisk]

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

Filter by
Sorted by
Tagged with
5
votes
4answers
17k views

“blocks” column in output of fdisk

On my machine, fdisk -lu /dev/sda displays following output: Device Boot Start End Blocks Id System /dev/sda1 * 2048 73947135 36972544 83 Linux /dev/sda2 ...
18
votes
6answers
51k views

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 ...
3
votes
1answer
408 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=...
23
votes
4answers
54k 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?
14
votes
2answers
22k views

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

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 ...
0
votes
1answer
17k views

How can I extend VMware Partition on Centos 7 using GParted?

I've a problem with increasing a partition from 20GB to 120GB, VMDK file. Here is what I've done: using vmware-diskmanager to increase vmdk file from 20 GB - 120 GB. It's ok. download and boot from ...
11
votes
3answers
4k views

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 ...
9
votes
1answer
8k views

reference whole disk (/dev/sda) using UUID

On my system (Debian), I can see the UUID identifier for all of my disks partitions (i.e. /dev/sda1, dev/sda2, ..) ls /dev/disk/by-uuid/ However, I don't see the UUID identifier for /dev/sda itself. ...
2
votes
1answer
11k views

fdisk: partition contains a ntfs signature. remove it?

I'm installing NixOs on a ThinkPad X220. Though I'm very comfortable in the shell, it's the first time I've set up my own system, and I'm running into some unknowns while trying to partition the hard ...
13
votes
2answers
4k views

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?
6
votes
1answer
14k views

How to use sudo -u option?

I have 2 users, userA and userB. userB needs to run some commands as userA. I have specified these options in /etc/sudoers as below: userA ALL=(ALL) ALL userB ALL=(vinoth) /sbin/fdisk I ran this ...
4
votes
2answers
10k views

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

Software RAID 10 + LVM on mixed drives, sector alignment?

I have 4 2.5" 7.2k drives lying about and I'd like to build some RAID arrays for a bit of VM storage on my KVM lab box. There are 2x 320GB drives and 2x 500GB drives. I'm looking to create a RAID 10 ...
4
votes
0answers
363 views

How to write to an .img file with two different partitions?

I have been working on building a Linux based OS for Raspberry-pi using buildroot. I am generating the required empty .img file using "dd" and "fdisk" utilities. I am creating two empty partitions as ...
4
votes
2answers
5k views

I ran fdisk on a wrong drive. How can I recover

I ran fdisk on the wrong HD. I basically cleared partition table, pressed w and quited fdisk and only then realized that that was my main harddrive... I got this message: WARNING: Re-reading ...
3
votes
2answers
320 views

Why does this change render my Block Device unbootable?

I'm working with Amazon Linux in AWS and attempting to setup multiple file systems on a single EBS Volume (block device) for compliance reasons. I'm doing this by mounting an EBS Volume to an already-...
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 ...
2
votes
1answer
1k views

Linux big disk partition issue

I have a big disk around 4.8 TB (RAID) and it has following partition (created by fdisk) [root@server1 ~]# fdisk -l /dev/sde WARNING: The size of this disk is 4.8 TB (4796404727808 bytes). DOS ...
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 ...
2
votes
1answer
5k views

resize2fs fail to resize partition to full capacity?

Added a new disk (/dev/vdb) of 2TB with existing data from the previous 1TB disk. I used fdisk /dev/vdb to extend its only partition /dev/vdb1 to full capacity of 2TB from previous 1TB. And then I ...
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: ...
1
vote
0answers
1k views

Creating partition tables on USB ATA drives fails with fdisk and KDE partitionmanager

I have a couple old ATA (yes, not SATA) hard drive around with USB enclosures. One of them gave me some EXT4 journal error, so I am not sure whether they have a physical problem. Since they are just ...
1
vote
1answer
108 views

Are partition tables always required? [duplicate]

So I have a home server with 4 hdds: hdd1: 60Gb (SSD - OS drive) hdd2: 4TB (data drive) hdd3: 2TB (data drive) hdd4: 1TB (data drive) So I intend installing ubuntu server onto hdd1 (ssd drive)...
1
vote
2answers
1k views

lvm and a partitioning question

So when I do (as a root) fdisk -l I see /dev/sda1 and /dev/sda2 Now I am practicing creating logical volumes, when I tried partitioning /dev/sda2 I got two new partition /dev/sda2p1 and /dev/...
0
votes
2answers
413 views

Wipe a USB flash drive and recreate a filesystem

I'm using this to wipe a USB flash drive and recreate a FAT filesystem: dd if=/dev/zero of=/dev/sdb bs=1M #I don't need more advanced wiping fdisk /dev/sdb (a few keystrokes to select partition ...
0
votes
1answer
102 views

How to migrate partitions and file systems to another device

I have an existing system with partitions but want to move them to a new device. The new device may be smaller and be connected to the system differently then the existing device. How do I move the ...
-1
votes
2answers
74 views

Linux + how to capture the OS disk device [closed]

we want to capture the disk device that belong to the OS ( Linux ) since each linux machine have list of disks that are not the OS , we want to capture the disk that belong to the OS so by fdisk ...