# [Closed] Weird thing with deleting partitions

## m.s.w

I had two hard drives. One was /dev/sdb and I had there four primary partitions

One of the partitions was /dev/sdb4 whch was used as windows partition. I had entry in fstab for automaticaly mouting this partition.

Now, I get new hard drives, but I left the drive, and it's even connected in the same place so it is still /dev/hda.

I deleted all partitions on this drive using fstab. I created one partition that takes whole disk surface. I restarted computer. I realized, that I did't deleted an entry in fstab for /dev/sdb2 partition. Strange thing is, that even there is no /dev/sdb2 device, after rebboting the system I have /mnt/windows mounted (/dev/sdb2) and I can see files there just like the partitions where not deleted.

When I run "fdisk /dev/sdb" I see only one partition there, /dev/sdb1 which I created.

Manualu I can't mount /dev/sdb2 becouse there is no such device /dev/sdb2.

But during boot, this partition is mounted and I cane see files there.

Can somebody explain me what exactly is going on? Why during boot Linux can mount non-existant partition and show files there?

----------

## NeddySeagoon

m.s.w,

Drives with SCSI names, like /dev/sdb  are named accoring to their detection order.

The detection order can vary with BIOS settings, also when you add drives.

I suspect your drive ordering has changed.

Please post the output of 

```
fdisk -l
```

 and the content of your /etc/fstab

----------

## m.s.w

I know what you think, but this is not the case.

I mean. The drive is connected in that way that it is again /dev/sdb.

```
Disk /dev/sda: 150.0 GB, 150039945216 bytes

255 heads, 63 sectors/track, 18241 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x836302d3

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1           9       72261   83  Linux

/dev/sda2              10          75      530145   82  Linux swap / Solaris

/dev/sda3              76        7909    62926605   83  Linux

/dev/sda4            7910       18241    82991790   83  Linux

Disk /dev/sdb: 80.0 GB, 80026361856 bytes

255 heads, 63 sectors/track, 9729 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x195c195c

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   *           1        9729    78148161    7  HPFS/NTFS

Disk /dev/sdc: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x78ba6d34

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1       53523   429923466   83  Linux

/dev/sdc2           53524       60801    58460535   83  Linux

```

As you can see /dev/sdb consists of only one partition.

----------

## NeddySeagoon

m.s.w,

Hmm.  Please post the content of your /etc/fstab and the output of mount ... with no parameters.

----------

## m.s.w

/etc/fstab

```
/dev/sda1               /boot           ext3            noauto,noatime  1 2

/dev/sda3               /               ext3            noatime         0 1

/dev/sdc1               /home           reiserfs        noatime         0 2

/dev/sdc2               /virtuals       xfs             noatime         0 2

/dev/sda4               /home/maniek/Video      reiserfs        noatime 0 2

#/dev/sdb3              /home/maniek/Movies     reiserfs        noatime 0 2

#/dev/sdb2              /virtuals       ext3            noatime         0 2

/dev/sda2               none            swap            sw              0 0

#/dev/sr0               /mnt/Plextor    auto            user,iocharset=iso8859-2,noauto,ro       0 0

/dev/sr0                /mnt/LiteON     auto            user,iocharset=iso8859-2,noauto,ro       0 0

#/dev/hdd               /mnt/Plextor    auto            user,noauto,ro          0 0

/dev/sdb1               /mnt/windows    ntfs-3g         locale=pl_PL.utf8       0 0

/dev/sdd1               /mnt/Kingston   auto            iocharset=utf8,rw,users,umask=0220 0

#/dev/hda2              /mnt/windows    ntfs            nls=utf8,ro,umask=022   0 0

```

mount

```

rootfs on / type rootfs (rw)

/dev/root on / type ext3 (rw,noatime,errors=continue,data=writeback)

proc on /proc type proc (rw,relatime)

rc-svcdir on /lib/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)

udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)

devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)

shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)

/dev/sdc1 on /home type reiserfs (rw,noatime)

/dev/sdc2 on /virtuals type xfs (rw,noatime)

/dev/sda4 on /home/maniek/Video type reiserfs (rw,noatime)

/dev/sdb1 on /mnt/windows type fuseblk (rw,allow_other,blksize=4096)

usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)

binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
```

OK, so now I see one mistake. The old windows partition wasn't /dev/sdb4 but /dev/sdb1.

But it seems that deleting and creating new partition table left data untouched on the /dev/sdb1 partition.

----------

## francofallica

 *m.s.w wrote:*   

> 
> 
> But it seems that deleting and creating new partition table left data untouched on the /dev/sdb1 partition.

 

you're right. fdisk does not touch your data at all. 

from the man page:

Hard disks can be divided into one or more logical disks called partitions. This division is described in the partition table found in sector 0 of the disk. 

means: That fdisk only manipulates the first couple of blocks of your drive. 

Since you delete all partitions and made 1 new one. Which again start at the same blocknr. as your old windowspartition. And fstab tells the system that it is a windows partition. So it knows where and what it is. The data is still there and so is the superblock (first block of filesystem). 

So as long as you don't run mkfs on that partition you data will be there. and I guess you coul'd mount it manually too

franco

----------

