# weird, mounting / file system issue

## Guest

so i need to edit my /boot/grub/menu.lst file.

i try:

mount /dev/hda1 /boot

cd /boot

ls

its showing config.sys and autoexec.bat (!!). i formatted this drive from dos before installing gentoo.. i then used fdisk and Created my partitions like this:

1: boot

2: swap

3: /

...........somehow theres a fat partition that didnt get deleted??? when i created my partitions with fdisk i started at sector 1... wtf?

----------

## Guest

i of course started the install after that and then used linux fdisk

----------

## Spooky Ghost

Just doing a mount /device /mntpoint will try to autodetect the filesystem.  Did you create an ext2 (or whatever) filesystem on the partition?  If not it probably still thinks it's FAT/VFAT and is reading the FAT which is why it is still finding old DOS files.  Also, did you set the partion type of the filesystems to 82/83 as appropriate, this might also be used as a cue in the filesystem type detection.

----------

## arkane

yeah, your right, those things are right on the money.

what I do usually is:

fdisk /dev/hda (whatever drive)

inside fdisk:  p

/dev/hda1 blah

/dev/hda2 /blah

etc... delete everything and create new.  Or, if thats not what ya wanna do, just change the type to 83 and write/quit.

Then, format.  (mke2fs, mkfs.xfs, mkfs.reiserfs, etc...)  Should never see the dos stuff again.

----------

## Guest

yea its my boot partition, i used mke2fs to make an ext2 partition.....it worked on the install? and if it wasnt working how can i still boot correctly into linux?

----------

## Guest

ok so your right something got screwy with fdisk.

when i created the partitions originally it started at like sector 64 instead of 1. so now i have a tiny fat partition. the weird thing and t he reason i didnt catch it is because it doesnt show up on the print partition table in fdisk but if you go into expert mode it does. 

is there a way to resize only this partition (to include the first 63 sectors) and kill the dos one w/out having to delete my boot partition? or a way to copy my boot partition to a temporary space so i do not have to reinstall? (how would i mount it if i/dev/hda1 shows the dos one and /dev/hda2 is swap?)

----------

## arkane

 *Quote:*   

> 
> 
> is there a way to resize only this partition (to include the first 63 sectors) and kill the dos one w/out having to delete my boot partition? or a way to copy my boot partition to a temporary space so i do not have to reinstall? (how would i mount it if i/dev/hda1 shows the dos one and /dev/hda2 is swap?)
> 
> 

 

Partition Magic would offer the ability to resize the partition.  I think there is also a GNU/GPL utility out there called partsomethingorother that does the same thing but isn't as intuative as Partition Magic.... you can also tar up the boot partition and put it to another partition for safe keeping while you do any operations.. then slap it back in there.  grub takes care of the pointing, so you don't have to worry about the files once you put them back into the /boot partition, other than having menu.lst pointing to the proper place.

Doesn't mount look at the superblock of a filesystem, instead of looking at it's type in the partition?  (superblocks created during the filesystem creation)  If it gripes, I wonder if doing a "mount -t ext2 /dev/hda1 /mnt" wouldn't work?

if it were me, I'd just tar up the partition, put it into another, nix the partition and remake it, reformat, and slap the stuff back into place. (assuming it's the /boot directory)

----------

## Guest

[quote="arkane"] *Quote:*   

> 
> 
> Doesn't mount look at the superblock of a filesystem, instead of looking at it's type in the partition?  (superblocks created during the filesystem creation)  If it gripes, I wonder if doing a "mount -t ext2 /dev/hda1 /mnt" wouldn't work?
> 
> 

 

thats what i was going for, but i couldnt get it to mount so i just couldnt access it to tar it up. i tried using parted and fdisk to clean up my error but no dice, none of them would recognize it and i couldnt just resize because parted says you cant change the start of an ext2 partition.

your mount command worked great. i hoped id be able to fix it. i just couldnt get that damn partition to go away. in theory it shouldnt even have been there, i used linux fdisk and dos fdisk and both said it wasnt there.. but it remains! i re-created the boot partition a couple of times and it worked but it just wouldnt start from the begining.

oh well, im gonna start over and not rush through fdisk this time  :Smile: 

thx for the help

----------

## AutoBot

Guest you can always zero out your partition before installing linux by doing:

```

if=/dev/zero of=/dev/hda count=1

```

----------

