Severe fdisk problem leading to data loss?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I recently lost 10H of work because fdisk did something very bad: it created
multiple partitions starting in the same place, and when I mkfs'ed sda2, it
overwrote enough of sda4 to trash it beyond repair as well as killed linux by
writing over its swap on sda3

This is what my partitions looked like before I lost my system:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes                                                          
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors                                
Units = sectors of 1 * 512 = 512 bytes                                                                 
Sector size (logical/physical): 512 bytes / 512 bytes                                                  
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                      
Disk identifier: 0x0b8ccbaa                                                                            
                                                                                                       
   Device Boot      Start         End      Blocks   Id  System                                         
/dev/sda1            2048     1050623      524288   83  Linux                                          
/dev/sda2         1050624   105908223    52428800    0  Empty                                          
/dev/sda3         1050624    34605055    16777216   82  Linux swap / Solaris                           
/dev/sda4        34605056  1953525167   959460056   83  Linux        

Sure enough, it's reproduceable.
I'm kind of very late and should go to bed (doing a full restore of my laptop now from 
backup). Would you be able to pass this to the right folks?

gandalfthegreat:~# dpkg -l util-linux
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version        Architecture   Description
+++-===================-==============-==============-============================================
ii  util-linux          2.20.1-5.5     amd64          Miscellaneous system utilities
gandalfthegreat:~# fdisk -v
fdisk (util-linux 2.20.1)
gandalfthegreat:~# 


(I'm using -H32 -S32 here, but last time, I ran fdisk without them)
gandalfthegreat:/var/tmp# fdisk -H32 -S32 /dev/sda

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
32 heads, 32 sectors/track, 1907739 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0b8ccbaa

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     1050623      524288   83  Linux
/dev/sda2         1050624   105908223    52428800    0  Empty

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 3): 
Using default value 3
First sector (1050624-1953525167, default 1050624): 105908224 << eek default is bad
Last sector, +sectors or +size{K,M,G} (105908224-1953525167, default 1953525167): +16G

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
Selected partition 4
First sector (1050624-1953525167, default 1050624):   << eek default is bad again
Using default value 1050624
Last sector, +sectors or +size{K,M,G} (1050624-105908223, default 105908223): 
Using default value 105908223

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
32 heads, 32 sectors/track, 1907739 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0b8ccbaa

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     1050623      524288   83  Linux
/dev/sda2         1050624   105908223    52428800    0  Empty
/dev/sda3       105908224   139462655    16777216   83  Linux
/dev/sda4         1050624   105908223    52428800   83  Linux

This looks like a severe bug. 
Kernel was 3.11 if that helps.

Disk is:
Device Model:     Samsung SSD 840 EVO 1TB
Serial Number:    S1D9NEAD934600N
LU WWN Device Id: 5 002538 85009a8ff
Firmware Version: EXT0BB0Q
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
ATA Standard is:  ATA-8-ACS revision 4c

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux