Visit Our UNIX and Linux User Community


Remove /dev/sdb partition using fdisk - BY ACCIDENT!


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Remove /dev/sdb partition using fdisk - BY ACCIDENT!
# 1  
Old 03-31-2008
Remove /dev/sdb partition using fdisk - BY ACCIDENT!

Hello everyone -

Please forgive me if I violate the forum's etiquette as this is my very first post. I'm posting this on both the dummies and the advance section with the hope for any responses.

I stumbled on this forum while frantically looking for an answer to a dumb, ignorant thing I did today.

I inherited a system and while doing some exploratory tasks, I used the "fdisk /dev/sdb" command to look inside the disk /dev/sdb. While there, I accidentally hit the 'd', enter, 'w' ... effectively wiped out /dev/sdb?

Here's what I found:
(1) /dev/sdb is a stack of four drives belonging to a hardware RAID5 setup.

(2) The /etc/fstab file has this labeled as "home" and mounted as /home on the system.

(3) Looked like users can still access /home for read/write, and they continues to log in and out.

And so, my question to all the gurus: What was the damage from my using of the fdisk tasks?
# 2  
Old 03-31-2008
It will probably be gone after the next reboot. RAID complicates matters, but I think you just might be lucky enough that it could be recovered if you can figure out what numbers to put in when you create a new partition with exactly the same parameters as the one you deleted.

There are also tools which can help you make an educated guess. TestDisk - CGSecurity is one I personally had some success with under similar circumstances.

This is Linux, right? Make a lot of sense to include platform information for this sort of question.
# 3  
Old 03-31-2008
Backups?

An emergency maintenance should be declared immediately to determine the damage.
Worst case: Users will not be able to commit data to disk so they are losing a days
production and all of their previous data as well.
# 4  
Old 03-31-2008
Remove /dev/sdb partition using fdisk - BY ACCIDENT!

Quote:
Originally Posted by era
It will probably be gone after the next reboot. RAID complicates matters, but I think you just might be lucky enough that it could be recovered if you can figure out what numbers to put in when you create a new partition with exactly the same parameters as the one you deleted.

There are also tools which can help you make an educated guess. TestDisk - CGSecurity is one I personally had some success with under similar circumstances.

This is Linux, right? Make a lot of sense to include platform information for this sort of question.
Sorry, I was in sort of a panic mode and forgot other detail. This is a server running CentOS 4.5. The system partition is on a separate raid1 set and identified as /dev/sda; The one I messed up was /dev/sdb, and it contains all the users "home" directory. As of now, from the user's side, I don't think my mistake affect anyone. But for how long, I really don't know.

I will take a look at TestDisk and would really appreciate all advice and suggestions.

K.
# 5  
Old 04-01-2008
My experience on Debian / Ubuntu suggests that the kernel will stick to the disk geometry it read at boot for a drive which is mounted, but of course, if you unmount, remounting will probably not work until the partition table is sane again. Certainly ramen_noodle's advice is sound.
# 6  
Old 04-02-2008
Things are still running as of today so I'm still puzzled about the extend of the damage. As root, I did a "cp -a" command and copied the entire 1.7+ TB out to another attached raid5 set.

Because this is a hardware raid set, can I assume that the OS just see this set as one single disk drive? In the past, when I had server with a corrupted system drive, I could just physically unplug the data drive and attach it to another running server, then mount this data drive on /mnt and all the data would be there. I'm wondering if I can treat this raid set the same way.

Many thanks for your kind responses.

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Changing grub from /dev/sda to /dev/sdb

Hi, Please suggest steps to change grub from /dev/sda to /dev/sdb, (1 Reply)
Discussion started by: manoj.solaris
1 Replies

2. UNIX for Advanced & Expert Users

Disk /dev/sdb doesn't contain a valid partition table

Hello, I have rebooted the RHEL VM but after rebooting the vm it not showing all the partition mounted on OS level, if i'll execute the fdisk -l command, then i'm able to see the same disk. below is the fdisk output : # fdisk -l Disk /dev/sda: 107.6 GB, 107639996416 bytes 255 heads, 63... (1 Reply)
Discussion started by: purushottamaher
1 Replies

3. Solaris

Lun remove, stuck in /dev/dsk and /dev/rdsk

So, we removed a LUN from the SAN and the system is refusing to remove the references to it in the /dev folder. I've done the following: devfsadm -Cv powermt -q luxadm -e offline <drive path> luxadm probe All those commands failed to remove the path. The drive stills shows up as <drive... (13 Replies)
Discussion started by: DustinT
13 Replies

4. Red Hat

Can I change the partition type with fdisk without disrupting data?

Hello, I have been going through our environment and I see we have a few servers with LVM's setup and the file system type is still set to "83" within fdisk. If I change this to "8e", will it hurt the data or cause any loss? I need to know for sure before I make the change. (1 Reply)
Discussion started by: s ladd
1 Replies

5. Shell Programming and Scripting

Non-interactive fdisk partition in script

Hi, How can I run fdisk partition in a script without interactive input? In manual procedure, I run fdisk device, select n, select p, presess enter for default start number (1), press enter to default end number, then select w for writing to the partition table. The command looks like... (3 Replies)
Discussion started by: hce
3 Replies

6. Filesystems, Disks and Memory

Partition management: lvm? fdisk? parted? (on RAID)

Hello, I have a RHEL system with two 500GB hard drives in RAID 1 (I think hardware, but not 100% certain - any way to tell?). It looks like it was just set up in default configuration with a small boot partition and one huge partition for the rest, which composes a LVM volume. I want... (1 Reply)
Discussion started by: builder88
1 Replies

7. UNIX for Dummies Questions & Answers

OS X fdisk - Remove bootable flag

I have a FAT32 data disk attached to my Mac. It has 1 partition that is marked as bootable and the Mac tries to boot from it even though it has no OS on it. The man page for fdisk tells how to turn on the boot flag for a partition, but not how to remove it. Is there a way? Thanks! (0 Replies)
Discussion started by: jkorchok
0 Replies

8. UNIX for Dummies Questions & Answers

Remove /dev/sdb partition using fdisk - BY ACCIDENT!

Hello everyone - Please forgive me if I violate the forum's etiquette as this is my very first post. I'm posting this on both the dummies and the advance section with the hope for any responses. I stumbled on this forum while frantically looking for an answer to a dumb, ignorant thing I did... (2 Replies)
Discussion started by: kevindoman
2 Replies

9. Filesystems, Disks and Memory

Ran out of space on /dev/root partition

hi, I have a SCO unix server which has a 36gb hard drive, but the IT company who supplied it assigned 1gb to /dev/root, 15mb to /dev/boot and 33gb to /dev/u. The /dev/root partition is now full, is there a way I can use the 33gb assigned to /dev/u without loosing any data, preferably... (2 Replies)
Discussion started by: Martyn
2 Replies

10. Solaris

recovery partition table from fdisk?

I have two disks on a sun blade 100. I just installed a solaris8 on the first disk. The installation was successful. But the problem is now I lost all data / partition on my second hard disk. The possible reason could be: 1. I used default web start install. During the installation I didn't... (2 Replies)
Discussion started by: motor98
2 Replies

Featured Tech Videos