A script-oriented tool for partitioning block devices.
Questions tagged [sfdisk]
42 questions
92
votes
9 answers
How to see disk details like manufacturer in Linux
With sfdisk -s I can see the disk capacity as follows:
$ sfdisk -s
/dev/cciss/c0d0: 143338560
total: 143338560 blocks
How do I see disk details like disk manufacturer? I tried hdparm, but got an error:
$ hdparm -i …
user3266
10
votes
1 answer
Forced reread of partition table: difference between BLKRRPART and BLKPG ioctl? (Linux)
When I want Linux to consider newly created partitions without rebooting, I have several tools available to force a refresh of the kernel "partition cache":
partx -va /dev/sdX
kpartx -va /dev/sdX
hdparm -z /dev/sdX
blockdev --rereadpt…
Totor
- 19,302
- 17
- 75
- 102
8
votes
2 answers
Is it possible to enlarge the / partition without rebooting?
I can enlarge the root (/) partition with fdisk without rebooting (deleting an recreating it with the same 1st sector, but greater last sector).
However, I cannot make the kernel to re-read the partition table :
# partx -va /dev/vda
partx:…
Totor
- 19,302
- 17
- 75
- 102
5
votes
4 answers
lsblk + capture only the disks
I want to capture only the disks from lsblk
as showing here fd0 also appears in spite its not really disk for use
in this case we can just do lsblk | grep disk | grep -v fd0
but maybe we missed some other devices that need to filter them by grep…
yael
- 12,598
- 51
- 169
- 303
5
votes
3 answers
replacing raid hard drives before failure (3 years old!)
I'm thinking that the smart thing to do with my raid setup is to replace the drives before they start failing and as they start to get old... I can't really afford a lot of cloud backup space, and I want to get a jump on the guaranteed eventual fail…
Eveready
- 51
- 4
5
votes
1 answer
Approximate partition table backup with sfdisk
I wanted to convert some logical partitions to extended ones, so I was following this accepted answer. However, at the step of backing up my current partition table, I messed up and typed the following instead of what was written.
sfdisk -f /dev/sda…
GeoffreyFrogeye
- 585
- 4
- 11
4
votes
1 answer
sfdisk - "This disk is currently in use" - but nothing seems to be using it?
# sfdisk /dev/mmcblk0p1
Welcome to sfdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Checking that no-one is using this disk right now ... FAILED
This disk…
sourcejedi
- 48,311
- 17
- 143
- 296
4
votes
1 answer
sfdisk --no-read doesn't work
I am trying to extend a partition using sfdisk on debian 8. I am running the following command:
sfdisk -H 255 -S 63 --quiet --Linux --leave-last -uM --force --no-reread /dev/md1 -N4 < /tmp/abc
I am getting the following error when I ran the…
vvnikhil
- 41
- 6
3
votes
2 answers
bad geometry: block count 967424 exceeds size of device (415232 blocks)
I am trying to understand what I did wrong with the following mount command.
Take the following file from here:
http://elinux.org/CI20_Distros#Debian_8_2016-02-02_Beta
Simply download the img file from here.
Then I verified the md5sum is correct…
malat
- 2,708
- 4
- 27
- 47
2
votes
2 answers
Are UUIDs and PTUUIDs important for MBR disks? If so, how do I create them on my own?
I'm studying partitioning under Linux, starting with sfdisk. If I copy a partition table from one drive to another, it'll copy the device UUID and the PTUUIDs for each partition, but if I'm creating a new device, I can specify a UUID for GPT drives,…
Tango
- 353
- 1
- 2
- 8
2
votes
1 answer
How to replace linux distro ISO on bootable USB keeping extra data partition intact and accessible?
USB sticks are getting larger. I'd like to store data in addition to having USB bootable. And I know how: 1. write ISO to USB stick 2. Add partition via Gnome-disks (both GUI).
Now I want to be able to replace ISO keeping that extra data intact and…
Martian2020
- 1,039
- 7
- 20
2
votes
1 answer
fdisk or sfdisk + how to show the disks size in GIB and not in GB
we can print all disks by the following ( on our RHEL machine )
fdisk -lu | grep "Disk /dev"
Disk /dev/sda: 247.0 GB, 246960619520 bytes, 482344960 sectors
Disk /dev/sdb: 4294 MB, 4294967296 bytes, 8388608 sectors
Disk /dev/sdc: 4294 MB, 4294967296…
yael
- 12,598
- 51
- 169
- 303
2
votes
1 answer
Redirecting output from within disk operations does not work
I am not able to successfully redirect STDOUT+STDERR on commands that operates with disks. Standard redirecting which always works, is somehow now catching the output. Two practical examples:
Example 1:
# wipefs --all --force /dev/sda…
Josef Komjati
- 23
- 3
2
votes
2 answers
Errors from cfdisk with new external USB backup drive
I've picked up an HP SimpleSave sd500a backup drive. This is a 2.5", 500GB drive. It has a mysterious CD-like partition, but otherwise seems to contain a WD Scorpio Blue disk. It seems that the CD-like partition is implemented in the enclosure's…
intuited
- 3,488
- 3
- 25
- 36
2
votes
2 answers
Missing argument option in sfdisk?
sfdisk --delete $disk
From Ubuntu 18.04 or later works. What is the equivalent command in Ubuntu 16.04 LTS?
Ubuntu 16.04 LTS (--delete missing),
Ubuntu 18.04 LTS (--delete present)
Riccardo La Marca
- 75
- 8