Questions tagged [parted]

A disk partitioning and partition resizing program.

Filter by
Sorted by
Tagged with
0 votes
0 answers
51 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
  • 227
0 votes
1 answer
193 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
159 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
60 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
22 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
65 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
0 answers
85 views

How can I resize partition in my case?

(parted) print free Model: VMware Virtual disk (scsi) Disk /dev/sda: 322GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File ...
Vladimir Fomin's user avatar
0 votes
1 answer
279 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
45 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
132 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
200 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
42 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
2k 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
1k 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
  • 53
1 vote
1 answer
163 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
  • 446
1 vote
1 answer
152 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,030
2 votes
1 answer
889 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
  • 12.8k
5 votes
1 answer
610 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
  • 53
2 votes
0 answers
595 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
2 votes
1 answer
1k 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
473 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
  • 12.8k
1 vote
1 answer
804 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
  • 12.8k
0 votes
1 answer
441 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
1k 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
241 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
386 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
  • 335
1 vote
1 answer
2k 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
641 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
  • 415
1 vote
3 answers
1k 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
509 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 Tang's user avatar
0 votes
2 answers
975 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
69 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
332 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
  • 287
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
195 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
31 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
860 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
106 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,870
-1 votes
1 answer
1k 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
  • 12.8k
4 votes
2 answers
8k 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
2k 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
  • 476
0 votes
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
  • 101
1 vote
0 answers
1k views

setting partition type in non-interactive parted command

I have a new disk in Linux (Centos): # fdisk -l /dev/sdb Disk /dev/sdb: 536 MB, 536870912 bytes, 1048576 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 ...
Chris's user avatar
  • 3,811
3 votes
1 answer
113 views

GPT disk looks different in external docking bay and internal swap bay

I have a hard disk that I use for backups via a USB 2.0 docking station. The disk has a GPT and one single ext4 partition. Everything is fine via the docking station, but if I attach the disk to an ...
ggll's user avatar
  • 153
0 votes
0 answers
71 views

broken pendrive. gui software is crashing. any ideas for commands ? it only seems for not lagging

yes. problem is : when i connect his pendrive PC automatically slow down after trying to change something in gparted, program immediately lags and i need to force close systems I'm using - ubuntu ...
hacknorris's user avatar
1 vote
0 answers
1k views

How to run parted mklabel in a script without user prompt?

I am trying to write a bashscript that will re-partition a drive using the parted utility. Since it is running in a script, I would like parted to not prompt the user for input (or alternatively, have ...
DCaruso's user avatar
  • 11
1 vote
0 answers
402 views

dd cloning process keeps the partition table but not the logical volumes and their names, why?

So I Am trying to clone a drive using dd via the following command #dd if=/dev/sda of=/dev/sdb bs=64k status=progress the command does what it is supposed to for the most part but the usb which was ...
MacLCM's user avatar
  • 73
0 votes
1 answer
1k views

Linux partition end is greater than the physical disk and partition size

I have two partitions on my hard drive. /dev/sdb1 for my entire system and /dev/sdb2 as a swap drive. I had a couple of system crashes and thought that I might need to increase the size of my swap ...
James's user avatar
  • 3

1
2 3 4 5