Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Did an fdisk on /dev/sdg on the wrong array and wrote it out before realizing .

Featured Replies

Hello

 

I was curious if there was a way to write the partition table for a disk (/dev/sdg) back to the disk from the kernel after most likely overwriting it.

 

I was working on my backups array and trying to format a few disks via unassigned devices that had been precleared.

 

Unassigned devices was greying out the format button for those drives so I was going to log into the server and delete the partition then format the drive from the command line.

 

I putty'd into my media server instead of my backups server and deleted partition one on /dev/sdg and wrote it to disk.

 

Once I realized my mistake I formatted a spare drive and mounted it on the media server and then started copying the files from disk10 - /dev/sdg over to it

 

Is there a way to fix (rewrite) the partition table? or should I continue with the file copy?

 

Thanks for your time,

Bobby

 

 

 

 

Command (m for help): p
Disk /dev/sdg: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdg1          64 3907029167 3907029104  1.8T 83 Linux

Command (m for help): d 
Selected partition 1
Partition 1 has been deleted.

Command (m for help): p
Disk /dev/sdg: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Command (m for help): w
The partition table has been altered.
q
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe( or kpartx(.

 

 

 

Since you wrote directly to the device, any changes will not have propagated to parity. So... theoretically you should be able to "fail" the drive by physically disconnecting it before the array is next started, and the emulated drive should be ok.

 

I'd continue backing it up, just in case my theory is wrong.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.