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

Re: "mount /dev/sde1" is old vfat whole disk unless "-t ext2"



On 10/19/2006 11:54 AM, Jameson C. Burt wrote:
I took a 4 year old 80GB disk drive, formerly running Microsoft Windows,
then repartitioned it with fdisk.
But I get the following odd behavior
  mount         /dev/sde1  /mnt  #Mounts as 80GB vfat
  mount -t ext2 /dev/sde1  /mnt  #Mounts as 1GB  ext2
Of course,  "-t ext2" will guarantee no other partition type gets used,
but a mount without options I would not expect to do either of
a. Mount the whole disk drive, all 80GB rather than 1GB.
b. Mount a different filesystem (vfat) type than I set with fdisk (83).

I suppose that any of the commands "shred", "wide", "sterilize", or
   dd   if=/dev/zero   of=/dev/sde   bs=1000  count=80000000
would prepare a disk drive so that later
no ext2 partition would "mount" as a Microsoft vfat partition.
However, one is behooved to use fewer such dangerous commands.
Since 1994, I have used the following standard sequence to prepare a Linux disk drive, whether that drive was old or new, fdisk (or cfdisk) to create partitions mkfs (or mke2fs) to put filesystems on those partitions
   /etc/fstab  changes if I want system mounts
   e2label  if I want to mount with a label
DID I MISS SOMETHING?

Like this oddity today, on another disk drive 6 years ago,
I was similarly perplexed by a first partition that misbehaved.

Configuration:
This "internal" Seagate ST380020A 80GB disk drive I attached to a CableMax
   USB2.0 to IDE & SATA Cable
so this bare (screwed on metal plate to protect electronics) ATA drive is externally connected by USB cable and a power
connection.
I run Debian 3.0 (not yet upgraded to 3.1).
I don't expect this configuration causes these oddities,
since I use this configuration often,
although I don't often convert Microsoft disk drives to Linux ext2.


The rest of this email supports the above statement.
Here is the output for my 80GB disk drive using
   fdisk -l /dev/sde
#
   Disk /dev/sde: 255 heads, 63 sectors, 9729 cylinders
   Units = cylinders of 16065 * 512 bytes
#
   Device Boot  Start  End    Blocks   Id  System
   /dev/sde1        1  141   1132551   83  Linux   #1.1GB
   /dev/sde2      142  422   2257132+  83  Linux   #2.2GB


When I run
   mount /dev/sde1  /mnt
I get the following response from  "mount",
   /dev/sde1 on /mnt type vfat (rw)
which is not ext2!
Indeed, I can see former Microsoft Windows files with  "ls -F /mnt",
My Documents/ Program Files/
   autoexec.bat*
   command.com*
   config.sys*
I get the following from  "df",
   /dev/sde1  78131104  78131104  0 100% /mnt
so the full 80GB disk drive has been mounted, not just /dev/sde1.


When I run
   mount -t ext2 /dev/sde1  /mnt
I get the following response from  "mount",
   /dev/sde1 on /mnt type ext2 (rw)
as expected from my settings with fdisk.
The files now include Linux (No Microsoft files) files/directories from /boot,
as seen by the following   "ls -F /mnt",
   grub/
   lost+found/
   boot.b
   bzImage-2.4.27-sound
   System.map-2.4.27-sound
   boot-bmp.b
   boot-compat.b
   boot-menu.b
   boot-text.b
   chain.b
   os2_d.b
   map
I get the following from  "df",
   /dev/sde1  1114724 14532   1043568   2% /mnt
as expected for my 1.1GB partition.




Maybe you forgot to reboot after changing the partition table. I think the procedure starts as this: create your partitions, reboot, format your partitions.

I don't think you need to wipe the whole disk. Just wipe the superblock of the partition (the first 512 bytes).

Or, to be safer, delete the current paritition(s), reboot, create new partition(s), reboot, wipe the superblock(s), format the paritition(s).

Backup your data first if not already backed up.

--
paduille.4060.mumia.w@earthlink.net




Reply to: