Questions tagged [parted]

A disk partitioning and partition resizing program.

Filter by
Sorted by
Tagged with
5 votes
1 answer
192 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 ...
  • 53
2 votes
0 answers
61 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 ...
1 vote
1 answer
97 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 ...
0 votes
2 answers
64 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 ...
  • 11.6k
1 vote
1 answer
108 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 ...
  • 11.6k
0 votes
1 answer
59 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 ...
  • 103
0 votes
0 answers
8 views

Why is RomBOOT failing when expanding GPT to fill SD card

I'm working with this SBC and trying to expand the rootfs partition on the manufacturer-supplied SD card (containing Ubuntu OS) to use unpartitioned space. The SD card is 32GB but less than 2GB is ...
  • 173
1 vote
0 answers
661 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 ...
0 votes
1 answer
198 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 ...
0 votes
1 answer
90 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 ...
0 votes
0 answers
73 views

"Unable to retrieve fs info" when resizing btrfs partition

I have a partition formatted with btrfs and mounted in /home and in / (according to the fstab file and lsblk -f). I want to shrink the filesystem, but both of the following commands return ERROR: ...
1 vote
1 answer
102 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 ...
  • 275
0 votes
1 answer
236 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 ...
1 vote
1 answer
166 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-...
  • 411
1 vote
3 answers
368 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 ...
0 votes
0 answers
34 views

How to perform the steps from this guide using Ubuntu

I don't have access to a win pc, and I'd like to ask if anyone could translate this guide to parted / gparted / fdisk in Ubuntu. I realise I may damage the card, hence I'd like to ask for help. The ...
0 votes
1 answer
179 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 ...
0 votes
2 answers
315 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 ...
1 vote
1 answer
45 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 ...
3 votes
2 answers
419 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 ...
  • 31
0 votes
2 answers
185 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 ...
  • 257
0 votes
2 answers
973 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 ...
1 vote
1 answer
116 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 ...
  • 26
-1 votes
1 answer
24 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 ...
2 votes
1 answer
240 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 ...
  • 397
0 votes
1 answer
53 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? # ...
  • 1,760
-1 votes
1 answer
407 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 ...
  • 11.6k
3 votes
2 answers
3k 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 (...
0 votes
1 answer
675 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 ...
  • 397
0 votes
2 answers
784 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 ...
  • 101
1 vote
0 answers
779 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 ...
  • 3,061
3 votes
1 answer
57 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 ...
  • 153
0 votes
0 answers
59 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 ...
1 vote
0 answers
791 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 ...
  • 11
1 vote
0 answers
153 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 ...
  • 63
0 votes
1 answer
775 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 ...
  • 3
-1 votes
1 answer
180 views

Volume show different sizes in CentOS 7

I hope you and your dears are very well. I'm facing a issue which I cannot understand the root cause. I have a VM with CentOS 7 64 bits. This VM has the following partitions: Filesystem Size ...
1 vote
1 answer
150 views

Inconsistent filesystem type reported after disabling journalling

In trying to understand why kworker flush uses 99% I/O and hangs file write on machine, I've disabled journalling on the ext4 data partitions using: tune2fs -O ^has_journal /dev/sdg1 After a reboot, ...
  • 419
1 vote
0 answers
989 views

How to shrink an encrypted BTRFS partition?

I have an external USB HDD (WD Elements). The entire drive is currently one large partition. Call it /dev/sda1. This partition was encrypted like this: cryptsetup -v --type luks --cipher aes-xts-...
  • 16.3k
1 vote
0 answers
49 views

What is the correct start offset for logical partitions? [duplicate]

Recently I've start to implement some script to run using Linux "parted" to change the partition structure on our SoC system. When doing that I've encounter with some problems, The ...
  • 13
1 vote
0 answers
42 views

Parted: Partition 1 (/dev/sdb1) not accessible after partition resize using parted

I used parted tool to shrink the main volume so that I can create a new partition on the HDD (capacity 2TB). I read articles and tried multiple options, like, GParted. But that didn't help. I was a ...
  • 111
0 votes
0 answers
49 views

Trying to create partition on hard drive

I am trying to create a partition on a physical hard drive. Here is the output I gent when I use print (parted) print Error: /dev/sdd: ...
  • 123
0 votes
1 answer
227 views

arch create EFI partition -- invalid token EFI System Partition

I'm following instructions given here for creation of EFI partition: https://wiki.archlinux.org/index.php/Parted But my installation is not behaving according to the description (parted) print Model:...
1 vote
1 answer
120 views

Are parted's end positions inclusive or exclusive

When creating partitions with parted, and when printing them back out, I was curious if the value for 'end' is inclusive or exclusive? Asked another way, is the second named in 'end' the last sector ...
  • 935
2 votes
2 answers
1k views

Parted says not aligned, but should be correct

Model: ATA Samsung SSD 850 (scsi) Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 ...
  • 123
0 votes
1 answer
382 views

Do I need to use partpobe and mkfs or can parted format the partition as ext4 automatically?

I am trying to create a single partition using parted command in Linux with ext4 file system using below command non interactively parted /dev/sdc --script -- mkpart primary ext4 0% 100% Could ...
1 vote
0 answers
54 views

Move Ubuntu install to new drive from safe mode

Currently my linux system will not boot because the partition it is on has no space left at all. I get an error when I was able to log in that said: " Warning unable to write to /tmp ". Now, ...
1 vote
1 answer
2k views

How to shrink a file image, produced with dd?

I tried the process from this post resize partition on an image file. I didn't succeed in understanding why it goes wrong in my case. I produced a 8GB image using dd. The image contains two partitions....
  • 173
2 votes
1 answer
302 views

fdisk dowsn't recognize SanDisk USB 3 Ultra Flair

I went through what I found about this subject in the most of the threads, unfortunately without success. I have the following situation. fdisk or parted doesn't recognize this sanDisk USB flash: ...
  • 315
0 votes
1 answer
6k views

How to recover filesystem and physical size mismatch

I was trying to shrink my home partition. I followed this ArchWiki article for that. According to this I first resized my filesystem using resize2fs and then resized my physical device using parted. ...

1
2 3 4 5