Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [parted]

A disk partitioning and partition resizing program.

Filter by
Sorted by
Tagged with
3 votes
1 answer
65 views

Parted in scripted mode can increase but not decrease partition size

I am trying to use parted in scripted mode to resize a partition. When I use the command to increase the partition size it works but when I use the same command but simply change the sector size to ...
FlexMcMurphy's user avatar
0 votes
1 answer
55 views

What is Recursive partition on /dev/sda

The disk I’m trying to recover the file system from, gives the error invalid partition table - recursive partition on /dev/sda. Is there a way to fix this particular problem? I’m using parted to ...
RWS's user avatar
  • 3
0 votes
1 answer
88 views

Which partition should be bootable, and why?

Using Debian 12.5 Bookworm, 64bit I wanted to teach myself how to partition my disks for my needs, so I did this: ——————————————————————————————| [!!] Partition Disks |—————————————————————————————— ...
NewbieDeveloper's user avatar
0 votes
0 answers
45 views

RHEL 7.2 + is it possible to resize partition sda2 when parted not support resizepart

we have old RHEL machines with version 7.2 ( RHEL 7.2 ) this machines has old parted version that not support resizepart so for example we can't use this syntax in order to resize sda partiton parted /...
yael's user avatar
  • 13.4k
0 votes
1 answer
103 views

How to expand FAT32 SD Card Image

Given sd_card.img that is 512000000 bytes (i.e. 488MB): $ file sd_card.img sd_card.img: DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x0,1,1), end-CHS (0xdf,15,54), startsector 63, 999873 ...
fm_user8's user avatar
  • 111
0 votes
0 answers
169 views

How to use dd for only allocated space?

I want to backup whole disk using DD. I have a 512 Gb disk with 3 partitions who take only 8 Gb and the rest is unused. root@routerMARS:~# parted /dev/sda print Model: ATA MT-512 (scsi) Disk /dev/sda:...
filimonic's user avatar
  • 131
2 votes
0 answers
59 views

500gb external hard drive listed with 512b only

Has anyone experienced this problem? I have a 500GB Seagate external hard drive that recently had some problems. Due to these problems I tried to format but unfortunately the formatting shows an error ...
Hudson Martins's user avatar
0 votes
0 answers
93 views

parted not recognizing loop device

I created a loop device with $ truncate -s 20G test.img $ losetup -fP ./test.img $ losetup -a /dev/loop0: [0032]:4051 (/tmp/test/test.img) lsblk is able to see it just fine $ test]# lsblk NAME ...
wasp256's user avatar
  • 209
0 votes
1 answer
1k views

Move partition to end of disk

I have a VM on Promox running Debian 11. I need to increase disk space, so I've resized disk in Proxmox GUI. But now, I need to enlarge root partition. This wouldn't be a problem, if root partition ...
rabudde's user avatar
  • 135
0 votes
1 answer
681 views

How to resize partition in-between other partitions (CLI)?

How can I resize some partitions on a disk where there are other partitions before and after it? I've found plenty of guides on the Internet about how to resize a partition (eg with parted), but they ...
Michael Altfield's user avatar
1 vote
2 answers
129 views

cannot mount vfat partition after running efibootmgr

I have created partition on my USB disk with parted parted /dev/sdb mklabel gpt mkpart boot fat32 0% 1024MB set 1 esp on set 1 boot on then I formatted the partition mkfs.vfat -F 32 /dev/sdb1 ...
Martin Vegter's user avatar
0 votes
1 answer
25 views

HowTo Enlarge volumeGroup

I run an ubuntu server and used cloneZilla to uprade my SSD from 256G to 1TByte. My /dev/sda3 has now a 1TB partition, but I can use only 256G as volumeGroup. How can I enlarge my volumeGroup? Thanks ...
RolfLang's user avatar
0 votes
1 answer
118 views

Cancelled ext4 shrink and now I can't seem to format the drive? parted, fdisk etc won't run with the drive

I was shrinking an ext4 partition, however it was taking too long so I thought I'd just start from scratch (making a new partition and wiping the data). However after I cancelled the resize (which was ...
Chris Stryczynski's user avatar
0 votes
1 answer
558 views

Wrong dependencies while upgrading to debian 12

I'm upgrading my debian 11 to 12 version and I'm blocked with apt. Error: parted: depends libparted2 (=3.4-1) but 3.5-3 will be installed (or "is installed" according to commands done) do ...
Mona_Lu's user avatar
  • 17
0 votes
1 answer
59 views

Regain full disk space after copying a small image file to a large USB device

I'm copying an image file (size: 2GB) to an USB disk on /dev/sda (size: 2TB) using dd: sudo dd if=2023-05-03-raspios-bullseye-arm64-lite.img of=/dev/sda bs=4M status=progress conv=fdatasync After dd, ...
Wolkenarchitekt's user avatar
1 vote
1 answer
447 views

Recover from parted -s /dev/sda1 mklabel gpt

Ok. Please don't judge me. I had no coffee yet when I did this... I tried to format a new USB drive and the drive didn't mount and I didn't think straight... long story short, I did parted -s /dev/...
Gerald's user avatar
  • 13
1 vote
1 answer
647 views

resize partition overlapping parted

parted -s -a opt /dev/sda "print free" Modèle: VMware Virtual disk (scsi) Disque /dev/sda : 268GB Taille des secteurs (logiques/physiques): 512B/512B Table de partitions : gpt Disk Flags: ...
Peutre's user avatar
  • 77
1 vote
0 answers
50 views

How to retrieve the deleted Partition table on linux?

I'm using the Ubuntu server. RAID 0 based logical volume was working fine on our server, but suddenly on restart of that server, the partition table is got deleted. Having some important data in that ...
Mohankumar S's user avatar
1 vote
0 answers
4k views

Error: Partition(s) have been written, but we have been unable to inform the kernel of the change - Ubuntu 18.04.6

I'm running an Ubuntu VM in Azure and am unable to notify the OS of partition table changes. az@prep-vm:~$ sudo parted /dev/sdb --script mklabel gpt mkpart xfspart xfs 0% 100% az@prep-vm:~$ sudo ...
Switch386's user avatar
  • 111
0 votes
1 answer
6k views

Change the size of the partition using parted

What am I doing wrong? I have an image, I added it as a loop device: losetup -P /dev/loop13 ./my_image.img gparted screenshot: Then I try to change the FS size for the partition first: e2fsck -f /...
Keonik's user avatar
  • 133
1 vote
1 answer
306 views

How to set a label and UUID for the entire drive?

I notice that some drives have label and UUID assiged on a drive level $ lsblk -dno PATH,LABEL,UUID /dev/sda SYSTEM 2019-02-12-05-40-19-00 /dev/sdb # No label & UUID ...
andreoss's user avatar
  • 120
1 vote
1 answer
271 views

Why does `parted` accept "xfspart" argument as valid `part-type`?

The Azure tutorial Use the portal to attach a data disk to a Linux VM shows the following command to prepare a disk: sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100% Looked at the ...
toraritte's user avatar
  • 1,102
2 votes
1 answer
1k views

parted + is it correct to create disk partitions in Linux only by percentage

we want to create 2 partitions from each new disk by parted command as the following example: sdg 8:96 0 50G 0 disk ├─sdg1 8:97 0 25G 0 part └─sdg2 ...
yael's user avatar
  • 13.4k
6 votes
1 answer
856 views

fdisk reports partitions are misaligned even when they don't appear to be

I have a new 4 TB Western Digital SN850X NVMe SSD drive that I am trying to partition as a boot drive for Ubuntu 20.04. No matter what I do, fdisk reports that the partitions are misaligned, even ...
David's user avatar
  • 63
2 votes
1 answer
1k views

How to use parted in script mode?

I'm trying to troubleshoot a script that used to work in some scenarios before. If I substitute script variables, what I'm trying to run is: parted -s /dev/sdb unit MiB resizepart 1 307199 This ...
Andrew Savinykh's user avatar
3 votes
1 answer
2k views

Fix GPT after using dd to clone a smaller disk onto a larger disk

I used dd to clone a smaller disk onto a larger disk, however now when booting I'm getting dmesg errors of: [Fri Sep 30 11:48:43 2022] GPT:Primary header thinks Alt. header is not at the end of the ...
Chris Stryczynski's user avatar
0 votes
2 answers
878 views

How do I find out what is the hard disk for OS in Linux

in our bash scripts , we have many places in the code that need to capture only the disk that related to OS ( operation linux/RHEL system ) we are using Linux versions as 7.2/7.5/7.6/7.9 , and on most ...
yael's user avatar
  • 13.4k
2 votes
1 answer
1k views

bash + how to automate creation of disk partitions in Linux

here is example from our rhel server machine lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 20G 0 disk /data/sdb sdc 8:32 0 20G 0 ...
yael's user avatar
  • 13.4k
0 votes
1 answer
594 views

Restore from Full Disk Image to Single Partition

For major version upgrades, Tails recommends this convoluted upgrade path where you write an image on a fresh USB drive, then clone the OS partition onto your original USB drive. I'm trying to figure ...
Jared's user avatar
  • 103
1 vote
0 answers
1k views

Extend the OS disk on Ubuntu 20.04

I have a VM on Azure with Ubuntu 20.04, the partitions looks like : # df -h Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs ...
Haribo's user avatar
  • 111
1 vote
1 answer
2k views

What are the detriments of not setting MSFTDATA flag when making a exFAT partition?

I have several external HDDs that I backup data to and occasionally plugin internally when I need access to the data. I erased all partitions by making a new GPT partition table on the disk. I made a ...
lohithbb's user avatar
0 votes
1 answer
310 views

Is there any benefit to partition the disk if only one partition is required? [duplicate]

I believe we could use the block device directly to do mkfs or create one partition through parted on linux and mkfs on top of the primary partition. However, I'm not sure if there is any ...
lordofire's user avatar
1 vote
1 answer
549 views

Parted on /dev/mapper/, What are the differences between Ignore and Cancel?

I am using parted to partition a /dev/mapper/luks_device. I know that I have to use kpartx to load the partition mappings afterwards (with reference to this thread). However while creating partition ...
midnite's user avatar
  • 443
1 vote
1 answer
3k views

Which "file system type" to choose in "parted" for an LVM volume?

Running RHEL 8, the parted utility asks for a "File system type" for the partition being created. If I plan to use LVM which should I choose? does it matter or I can choose any type of file ...
varinme's user avatar
  • 13
1 vote
1 answer
1k views

Why does Parted mkpart ask for file system type, if I can later format with another file system? [duplicate]

What I Did I attach an HDD, lsblk -S shows this drive as sdc I use sudo parted /dev/sdc/ to start parted against sdc I create a partition table as: mklabel gpt I make a partition: mkpart my-cool-...
dungarian's user avatar
  • 445
1 vote
3 answers
2k views

Can't write SD card partition table

I can't write the partition table on an SD card. IOCTL error. I can't delete it, either, neither in Linux using parted, cfdisk, or fdisk, nor in Windows, which just says format didn't work. The ...
wirelessben's user avatar
0 votes
1 answer
789 views

Partitions for loop device not found from script, visible elsewhere

I'm currently trying to partition and then format a disk image using parted, by first mounting a blank disk image onto a loop, creating the appropriate partitions, and then formatting these partitions ...
Larry's user avatar
  • 101
0 votes
2 answers
1k views

How to replicate bios_grub partition?

I have a 60GB AWS volume which I want to shrink to 30GB. The plan is to manually recreate the same partition table (with the only difference being the main partition size), and then use partclone to ...
Greendrake's user avatar
1 vote
1 answer
82 views

Is there a way to protect a disk from being formatted by parted?

It happens that here in my company we have our mail servers and everytime we need to upgrade disk space, we add a new disk in our VM and add it to the LVM, format it with parted and add the partition ...
Gabriel Ozzy's user avatar
3 votes
2 answers
2k views

extend logical volume using parted via script

I would to extend my logical volume via script. Before i had vm with 10 GB hdd, i incerease hdd 5 GB more, then its toatal 15 GB. What manually i run command to extend hard disk as follows: sudo ...
Sha's user avatar
  • 31
0 votes
2 answers
394 views

how to backup an SD card (containig OS) that is *not* properly seen by other computers, except it works fine to boot the OS(!)

I have this RaspberryPi booting from a 32 Gb sdcard. I took it off the RPi to make a back up but the card shows as a 32 Mb single partition everywhere I plug it. On my other Raspberry it is listed as ...
Rho Phi's user avatar
  • 319
2 votes
3 answers
3k views

parted: create swap partition on gpt disk (one liner) not working

I am trying to create a swap partition in my script using parted based on the Arch Linux guidance. https://wiki.archlinux.org/title/Parted#Partition_schemes Somehow it is always sort of skipping the ...
TheHellSite's user avatar
1 vote
1 answer
216 views

Move and shrink a partition at the same time

It is possible to shrink a partition with, for example, parted. It is also possible to move (copy) a partition from one hard drive to another, by creating a partition of the same size on the target ...
leo's user avatar
  • 26
-1 votes
1 answer
33 views

Disk partitioning and resizing

I installed Kali along side windows 10 but I just realized that I allocated too much space for Kali while I am running out of space in windows is there any way I can reallocate some of Kali space for ...
SOLOMON HEMI's user avatar
2 votes
1 answer
1k views

How can I fix LVM PV size after a botched encrypted partition shrinking

I apparently messed up today. I have to resize an encrypted root partition to make room for a windows dual boot. I followed instructions from the arch wiki since it seemed to match my needs even ...
nicoco's user avatar
  • 419
0 votes
1 answer
113 views

Why does drive image show different start partition free size?

I made an image of /dev/sdc. The free space before the first partition isn't reporting the same byte sizes, but why? The start position is reported as 1024B on the drive and 16384B on the image? # ...
Rucent88's user avatar
  • 1,880
-1 votes
1 answer
2k views

rhel + how to increase sdb1 after increasing sdb disk

on our rhel 7.2 VM server we increased the sdb disk ( not LVM ) from 200 to 220G , as the following ( sdb is with xfs fs ) sdb 8:16 0 200G 0 disk └─sdb1 8:17 0 200G ...
yael's user avatar
  • 13.4k
5 votes
2 answers
13k views

how do I shrink a partition, right after shrinking its filesystem with resize2fs?

This is what've done to shrink /home partition filesystem: e2fsck /dev/sda1 resize2fs /dev/sda1 150G As of now, if I run df it is going to show me that the partition has shrunk from 210G to 150G (...
surfboardcompound's user avatar
0 votes
1 answer
3k views

Can you delete a partition and the filesystem on it with parted?

I created a partition with parted and then removed it using parted /dev/<partition> rm partition number. After that I executed partprobe,udevadm settle and systmelctl daemon-reload. Then I used ...
Cruise5's user avatar
  • 526
1 vote
2 answers
2k views

External drive partition mounting but not found in parted

Here is my situation : I have an external hard drive of 320Gb. The drive is plugged using a disk docking, and mounts automatically when started. I can explore the directory tree, read and write in the ...
T3e's user avatar
  • 111

1
2 3 4 5 6