July 22, 20169 yr 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(.
July 22, 20169 yr 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.