Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I recently added some storage to a RAID array with a single large XFS volume. To expand the volume I normally use parted to remove the partition and then recreate it so that it spans the entire volume.

However, I accidentally removed a partition from /dev/sdb1 instead of /dev/sdb, and cannot seem to restore the partition.

BEFORE:

/dev/sdb looked something like:

(parted) unit s
(parted) print                                                            
Model: xxx
Disk /dev/sdb: 58589705392s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End           Size          File system  Name  Flags
 1      2048s    58589705358s  58589703311s  xfs          data

and,

/dev/sdb1 looked something like:

(parted) unit s (parted) print Model: Unknown (unknown) Disk /dev/sdb1: 58589705392s Sector size (logical/physical): 512B/512B Partition Table: loop

Number Start End Size File system Flags 1
0s 58589705392s 58589705392s xfs

(sizes might be a little bit off, but other flags like the partition type and filesystem type are accurate)

AFTER

After accidentally removing the partition in /dev/sdb1, I tried first recreating it in /dev/sdb1 with no luck, then I tried creating the partition in /dev/sdb using "mkpart primary xfs 2048s -1s", but the filesystem does not show up:

/dev/sdb now looks like:

(parted) unit s (parted) xxx /dev/sdb: 58589705392s Sector size (logical/physical): 512B/512B Partition Table: gpt

Number Start End Size File system Name Flags 1 2048s 58589705358s 58589703311s primary

when I try running parted /dev/sdb1 and looking at things there I get:

(parted) print Error: /dev/sdb1: unrecognised disk label

I've tried removing and recreating the partitions in a few different ways, but so far have not been able to restore the original XFS partition so that I can grow it

Any suggestions?

Any help would be greatly appreciated!

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.