Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[FAQF] UN1: Partition Mounts Wrong
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Mon Dec 02, 2002 11:25 pm    Post subject: [FAQF] UN1: Partition Mounts Wrong Reply with quote

This is the feedback thread for metalhedd's UN1: Partition Mounts Wrong. There's a lot of good dense information in there, metalhedd. I think it might benefit from some more descriptive and newbie-friendly phrasing. I'm still afraid that people who most often encounter this problem wouldn't necessarily be able to recognize themselves in here. Hopefully, you can edit your post in the FAQ forum. I tried to set it up so that anybody who has a post in there can edit it. If that doesn't work yet, please send me a PM.

More suggestions for improvement here wanted. I think this one has become the most common FAQ over the last couple of months, after klieber's aggressive campaign to stomp out the late-summer infestation of "Why can't I su to root?" reduced those significantly.
_________________
For every higher wall, there is a taller ladder


Last edited by rac on Thu Dec 05, 2002 11:05 pm; edited 2 times in total
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Dec 03, 2002 6:10 pm    Post subject: Reply with quote

The difference between Windows and Linux/UNIX when it comes to initializing a new disk is the format step. Windows uses a program called format to actually write to every block on the disk or if you use the /Q switch, it will only re-write the directory aka the index of the disk.

Linux/UNIX uses a program ala mke2fs to initialize the disk. This program only writes to a few blocks on the disk. The information written is to the superblock (and several copies of the superblock are stored in different physical locations around the disk for redundancy) and an intial i-node structure. The superblock contains basic information about the disk and where the first i-node structure is located. The i-node structure is, in a simplified way, similar to the directory structure on a Windows disk.

The problem where you actually may see files that existed on the Windows formatted disk after re-partitioning and using mke2fs is most likely due to trying to mount the partition without specifying the type of the partition, i.e:

mount /dev/hda4 /home

This will cause the mount program to read the first few blocks of the partition in order to determine the type of the partition. In this case, mount finds information indicating it is a Windows disk, and mounts the disk as type vfat. Now when you do an ls of the mount-point (/home) you may or may not see files that existed when the disk was still a Windows disk. The only file that should exits on a newly created Linux/Unix disk is the lost+found directory.

Now to avoid seeing the old Windows directory, try to mount the partition as follows:
mount -t ext3 /dev/hda4 /home
This will tell the mount program to treat the partition as an ext3 type partition and the only file on this disk is the lost+found directory. The ext3 must reflect the type of file-system that you created on this disk, i.e it can be ext2, ext3, reiserfs, xfs or several other types.

Bottom line is:
Alway use the type specifier, -t, when mounting a partition. This will ensure you that the partition gets mounted with the correct format.

Erik
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Tue Dec 03, 2002 7:45 pm    Post subject: Reply with quote

ebrostig, here's something I've never gotten a handle on about this problem: when the fstype is specified in /etc/fstab, and the partition is mounted automatically at startup, does it get mounted correctly? Can the ghost superblock data continue to cause problems? If so, then we really need to get people to zero it out before they put important data on it.

Say we have an infected hda1 that is destined for /boot. During the install the FAQ says "always use -t when mounting /mnt/gentoo/boot". So they do that, and everything looks OK. Then comes new kernel compilation time sometime down the road. User does "mount /boot". What happens?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
procrustes
n00b
n00b


Joined: 14 Jun 2002
Posts: 13

PostPosted: Wed Dec 04, 2002 11:17 pm    Post subject: fstab! Reply with quote

Well, if you type "mount /boot", the /boot partition will be looked up in /etc/fstab, which presumably has the correct partition type. The problems would start if you did not have an entry for /boot in fstab.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Dec 04, 2002 11:24 pm    Post subject: Reply with quote

If you didn't have an entry for /boot in fstab, then "mount /boot" wouldn't work because it wouldn't know which partition to mount there. Apologies if I'm reading too much into one word, but "presumably" worries me. If we're going to put this into a FAQ answer, I would prefer to have some concrete evidence from somebody who actually has experienced this problem and knows for sure whether having an entry in /etc/fstab is enough to overcome it.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
mooman
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 175
Location: Vancouver, WA

PostPosted: Wed Dec 04, 2002 11:27 pm    Post subject: Reply with quote

Can I just make a small request that however this gets published, we don't call it "sticky windows"? It sounds more like something that deals with pinning X-windows to a desktop or workspace than anything about boot sectors...
_________________
Linux user off and on since circa 1995
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Dec 04, 2002 11:30 pm    Post subject: Reply with quote

mooman wrote:
Can I just make a small request that however this gets published, we don't call it "sticky windows"?

Nope, not unless you come up with something else to substitute. If I just make the title blank, it's hard to click on the link. :P
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
the_bard
n00b
n00b


Joined: 03 Dec 2002
Posts: 60
Location: Albany, NY

PostPosted: Thu Dec 05, 2002 5:36 pm    Post subject: Reply with quote

How 'bout... "Windows Haunting Partition"?

Or... "Windows Just Refuses To Let Go"?

Then again... "Self-Denial And Windows"?

I am having way too much fun with this :lol:
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7730
Location: Underworld

PostPosted: Thu Dec 05, 2002 9:59 pm    Post subject: Reply with quote

I think that something like "Why my partition refuses to mount properly?" would be better. "Sticky windows" also remembers me the X sticky windows, or "Stinky Windows" 8)
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Thu Dec 05, 2002 11:06 pm    Post subject: Reply with quote

Anybody like "Partition Mounts Wrong" better? I'm trying to keep the titles short.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7730
Location: Underworld

PostPosted: Thu Dec 05, 2002 11:41 pm    Post subject: Reply with quote

This looks nice.

rac wrote:
Anybody like "Partition Mounts Wrong" better? I'm trying to keep the titles short.
Back to top
View user's profile Send private message
mooman
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 175
Location: Vancouver, WA

PostPosted: Fri Dec 06, 2002 1:48 am    Post subject: Reply with quote

As the original complainer I hereby bless it. :)
_________________
Linux user off and on since circa 1995
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7730
Location: Underworld

PostPosted: Fri Dec 06, 2002 2:02 am    Post subject: Reply with quote

Are you a Holy Cow to bless it? :)

mooman wrote:
As the original complainer I hereby bless it. :)
Back to top
View user's profile Send private message
mooman
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 175
Location: Vancouver, WA

PostPosted: Fri Dec 06, 2002 2:04 am    Post subject: Reply with quote

SShhhh. You're gonna get the mods to dump us in "Off the Wall" with talk like that...

But, yes, I am rather divine. :)
_________________
Linux user off and on since circa 1995
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Sat Dec 07, 2002 1:00 am    Post subject: Reply with quote

rac wrote:
ebrostig, here's something I've never gotten a handle on about this problem: when the fstype is specified in /etc/fstab, and the partition is mounted automatically at startup, does it get mounted correctly?

Yes, the boot process reads the superblock from the disk before actually booting anything.

rac wrote:
Can the ghost superblock data continue to cause problems? If so, then we really need to get people to zero it out before they put important data on it.

Well, it is not a ghost superblock per se. The problem is that, and I really don't know why - I would have to look at the source for mount to find out, the disk is recognized as a vfat rather than ext2/ext3 partition.

It is not really necessary to zero out the disk prior to making a filesystem on it. It doesn''t hurt to do it, but it may take a long time to do.

rac wrote:
Say we have an infected hda1 that is destined for /boot. During the install the FAQ says "always use -t when mounting /mnt/gentoo/boot". So they do that, and everything looks OK. Then comes new kernel compilation time sometime down the road. User does "mount /boot". What happens?


He may actually see the incorrect directory entries, but then again he may not. It all depends on what is written where.

If your /etc/fstab is set correctly, all you need to do is:
mount /boot

This will read your /etc/fstab to see what needs to be mounted on /boot and find the correct partition type there.
Try it and you will see.

Erik
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sat Dec 07, 2002 7:10 am    Post subject: Reply with quote

ebrostig wrote:
rac wrote:
Can the ghost superblock data continue to cause problems? If so, then we really need to get people to zero it out before they put important data on it.

Well, it is not a ghost superblock per se. The problem is that, and I really don't know why - I would have to look at the source for mount to find out, the disk is recognized as a vfat rather than ext2/ext3 partition.
Since dd fixes it, but mkfs doesn't, that's why I thought it was ghost data in the superblock.
Quote:
It is not really necessary to zero out the disk prior to making a filesystem on it. It doesn''t hurt to do it, but it may take a long time to do.
As I understand the "ghost superblock" threads, once people's partitions get "infected", dd is the only thing that fixes it permanently. I could be misunderstanding, but that's the way I read it. Again, since I've never seen this firsthand, it's hard for me to say much of anything definitively.
Quote:
If your /etc/fstab is set correctly, all you need to do is:
mount /boot

This will read your /etc/fstab to see what needs to be mounted on /boot and find the correct partition type there.
Try it and you will see.
I understand that that's how it normally works. But I'm curious as to whether it really works that way for these people with infected partitions or not.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum