Questions tagged [fdisk]

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

Filter by
Sorted by
Tagged with
4
votes
2answers
149 views

Restore a USB flash drive in a standard state for use in Linux, Windows, etc

Since this question, I'm using: dd if=/dev/zero of=/dev/sdb bs=1M # wipe the disk fdisk /dev/sdb <<< $'n\np\n\n\n\nt\nb\np\nw\n' # create a partition mkfs.fat /dev/sdb1 ...
4
votes
1answer
428 views

Odd output from fdisk -l: overlapping and missing partitions? [duplicate]

I am running Debian 8 as the only operating system on my Toshiba Satellite laptop, though I previously had other operating systems installed. Running the command sudo fdisk -l produces the following ...
4
votes
1answer
2k views

fdisk, dd, and the Rapsberry pi

I was trying to wipe my 4GB SD card which acts as the hard drive for the Raspberry Pi, so I went into Mac OS X Disk Utility* and Erased the entire disk, and specified that the whole disk be one big ...
4
votes
1answer
4k views

USB stick isn't recognized correctly by Linux Mint

I've got a usb stick which isn't recognized correctly by my system (Linux Mint 18, kernel version 4.4.0-34-generic). With lsusb the device is shown (it's the Kingston Technology DataTraveler G4): Bus ...
4
votes
1answer
651 views

“Can't have a partition outside the disk!” for vdi created from a truncated image

I have used dd to create a partial/truncated image of a disk which only includes allocated spaces, then converted it to a vdi file for VirtualBox. I have successfully used the vdi image to run the ...
4
votes
2answers
13k views

Copy MBR and boot partition to a smaller disk

I'm using a 32GB SD card for my raspberry pi. I have successfully transferred the operating system (Archlinux ARM) to a usb harddrive. Which means that I only need the boot partition on the SD card. ...
4
votes
0answers
1k views

How to interpret fdisk output?

How does one interpret fdisk -l output. I've included a sample output based on an image with my "best guesses", and then show the output based on the device which was used to create the image. ...
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 ...
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 ...
3
votes
1answer
450 views

Why doesn't `less` show bold output? [duplicate]

I'm connected to a bash shell on my ubuntu 16.04 server using Putty on Windows. This is what it looks like in Putty when I do sudo fdisk -l: But when I try to pipe the output into less, the colors ...
3
votes
3answers
18k views

Format windows (NTFS) hard drive on Ubuntu using command line

I had an old Windows machine which recently died. So I decided to put the hard drive into my Ubuntu server. This hard drive is currently NTFS file format, the Disk info is as follows description: ...
3
votes
2answers
8k views

fdisk (expert mode) options

On GNU/Linux with fdisk (util-linux 2.20.1), when using, say fdisk /dev/sda3 there are quite some options and the and even an "expert mode" (x). Most of these are explained through the m option. But ...
3
votes
1answer
166 views

How do all the partition types differ from each other?

While making partitions in a Unix environment, we often define partition type. When we make partitions using fdisk command, and when we use L to get the hex codes of available partition types, we get ...
3
votes
2answers
603 views

freshly created partition missing even after partprobe, shows no such device or address

On Ubuntu 14.04 I am trying to create new partitions but it's failing to create the filesystem fdisk -l /dev/sde WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't ...
3
votes
1answer
10k views

Use “tune2fs” on XFS filesystem, get “Couldn't find valid filesystem superblock.”

I ran into this message two days ago=: tune2fs: Bad magic number in super-block while trying to open /dev/vdc1 Couldn't find valid filesystem superblock. The system is Ubuntu, a KVM virtual machine ...
3
votes
1answer
4k views

location of the “disk identifier”

According to Wikipedia, "disk signature" is a 32 bit value stored in MBR on bytes 440 - 443. According to fdisk, my "disk identifier" is 00043afc in hex: # fdisk -lu /dev/sda | grep identi Disk ...
3
votes
2answers
218 views

Difference between running mke2fs and setting FS type in cfdisk?

When I run cfdisk (or fdisk) to partition a storage device, there's a point where I can specify the file system type. Does this do anything with respect to the actual file system? Suppose I want to ...
3
votes
1answer
92 views

Partition table consuming 32K of data?

I create a file of 100MB size, and using losetup assign it to /dev/loop0. Consequently I use fdisk to create an empty DOS partition table, and a new partition that spans the entire disk. One thing ...
3
votes
2answers
5k views

How to create a new partition on a hard disk?

How do I create a new partition on a hard disk, from the terminal? I've been reading the man pages for fdisk and mkfs, but they're confusing. I need to know how to create a new partition on a blank ...
3
votes
2answers
325 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-...
3
votes
1answer
3k views

How can I mount this .img file and browse its contents?

I am interested in mounting a firmware image and browsing its contents. I attempted this with the mount command but received some errors ("you must specify filesystem type"). However I think there may ...
3
votes
2answers
10k views

resize root volume with lvextend insufficent space error

My root partition is running out of space, so I'm trying to extend/resize it. Filesystem Size Used Avail Use% Mounted on /dev/mapper/u64-root 19G 18G 823M 96% / none ...
3
votes
2answers
3k views

Creating disk device in a file

I'm trying to create disk device in a file with: dd if=/dev/zero of=file.img bs=516096 count=1000 sudo losetup /dev/loop0 file.img (echo n; echo p; echo 1; echo ""; echo ""; echo w;) | sudo fdisk -u -...
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-...
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 ...
3
votes
1answer
412 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=...
3
votes
1answer
127 views

HDD Testing En Masse

Does anyone have any ideas about how to set up automatic detection and conditional formatting of a LOT of HDDs? I tried posting this on TomsHardwareForums, but I don't think the responder read my ...
3
votes
1answer
62 views

Clone Debian installation

I want to clone an existing Debian installation and restore on a new machine with a hard drive of different size. The partioning is very easy - /dev/sda1 for EFI, /dev/sda2 for Linux and /dev/sda3 ...
3
votes
1answer
306 views

How can I see the size of a partition's unallocated size on the command line after shrinking a partition with resize2fs?

I want to shrink my /dev/sda2 partition from 463.37GB to 400GB to make room for a new partition. So I did e2fsck -f /dev/sda2 followed by resize2fs /dev/sda2 400G. As per man resize2fs, the ...
3
votes
1answer
2k views

Problem creating raw disk image and mounting it in rescue mode to QEMU

I am trying to create booting system from raw disk image. This is what I do: $ dd if=/dev/zero of=system2.img bs=1M count=6000 6000+0 records in 6000+0 records out 6291456000 bytes (6.3 GB) copied, ...
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 ...
3
votes
1answer
511 views

Why is the block size of a partition smaller than that of the underlying disk?

My understanding is that the block (in the phrase "block size") is like an IO buffer, or minimum IO size for a device. Since partitions are built on top of physical devices, how can they have blocks ...
3
votes
0answers
1k views

Expanding root partition CentOS 6 With using fdisk

I am trying to expand the root partition on a VM which is not using LVM and I do not have (nor want to try and create then use) a disk to boot from. As such I followed what I felt was the logical ...
3
votes
1answer
909 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
0answers
1k views

Disable RAID auto detect at runtime

In Linux, I'm partitioning two disks for RAID1 with fdisk. The first disk partitioning succedes, but the second fail because the raid starts automatically and occupy also the second disk (why? it ...
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
2answers
669 views

Does `/proc/partitions` and/or `fdisk -l /dev/sdX` provide me a reliable device size?

I have two 3TB disks, which I hope to be exactly the same size. This means that I can use dd to copy them without being short or in excess of some bytes. Therefore I tried to find out the capacity/...
2
votes
5answers
3k views

Extracting a string from fdisk command

I want to write a shell script, which will run fdisk -l and extract a string /dev/sdbn from the output of fdisk -l. Using extracted word I want to mount it to /mnt. For Example: Disk identifier: ...
2
votes
1answer
821 views

Do I need to format a CF before installing Linux?

I recently purchased an 8GB Patriot CF card, like this one . I also have a Syba CF/Sata adapter. I put these together into my mini-itx computer (connected via Sata cables, not USB) and booted an ...
2
votes
1answer
707 views

How change type of hard disk with the format command of SOLARIS

I would like to change the type of disk form : 15. c2t15d0 <Sun-STK RAID INT-V1.0 cyl 36417 alt 2 hd 255 sec 63> /pci@0,0/pci10de,375@f/pci108e,286@0/disk@f,0 to 15. c2t15d0 <...
2
votes
3answers
939 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 ...
2
votes
1answer
329 views

swapon command is not listing the lvm name

I am facing issues with swapon -s command. It is displaying some other filename instead of my lvm name which i have given ( swap is LVM partition ) swapon -s command is not listing my LVM Name for my ...
2
votes
3answers
3k views

What's the difference between fdisk -l and df -h?

In my ubuntu system, I want to have a look about my system disk info. When I use fdisk -l without sudo, I get nothing. But with sudo fdisk -l, I only get a device /dev/sda1, but when I use df -h, I ...
2
votes
1answer
243 views

fdisk. What does the “free” partition mean?

I had two primary partitions (/dev/sda1 and /dev/sda2). Then I created an extended partition to segment it into logical partitions. After I had typed fdisk /dev/sda and n (add a new partition) the ...
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 ...
2
votes
1answer
12k views

fdisk isn't showing my hard drive as properly formatted (but it is)

I've got 3 1TB drives which I've set up to use LVM. Here's the output of pvdisplay: --- Physical volume --- PV Name /dev/sda1 VG Name vgpool PV Size ...
2
votes
1answer
2k views

fdisk unable to open

I am having problems using fdisk to clear the partition table of my sd card. The sd card is identified in the /dev folder when inserted into the sd card reader, but when the following command in run: ...
2
votes
1answer
12k 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 ...
2
votes
1answer
336 views

Interpreting Gnu `df` command size results on Linux

I'm having a trouble understanding how df reports the size of filesystems: $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 924815840 63819748 813948260 ...
2
votes
2answers
2k views

How To Create a Bootable EBS Volume for Amazon Linux

Background My objective is to use Packer to create an Amazon Machine Image (AMI) with several different paths mounted to different filesystems to improve security. E.g. /tmp should be mounted to a ...