Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Find FS type
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Tue Nov 15, 2005 12:59 pm    Post subject: Find FS type Reply with quote

OK, this one might sound really stupid, but....
Is there a way to find out what format a partition is? I've had a problem mounting one particular partition, and can't figure out why. /etc/fstab shows it as being a different format from the rest of the system's disk's, and for the life of me I can't remember what format I made it when I setup the box.
Will it hurt a partition if I change /etc/fstab to another format type, and try to mount the partition?
Thanks.

- Mac
Back to top
View user's profile Send private message
Cocker68
Apprentice
Apprentice


Joined: 16 Jan 2003
Posts: 227
Location: Germany

PostPosted: Tue Nov 15, 2005 1:09 pm    Post subject: Reply with quote

The mount command itself tries to find out the FS, if its not given explicitly as a parameter.
Try
Code:
# mount /dev/hda7 /mnt/hda7
with Your partition, and see, if mount figures this out.

- Cocker :wq
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Tue Nov 15, 2005 5:34 pm    Post subject: Reply with quote

Thanks Cocker.
That's how I've been accessing the data on that partition, but mount doesn't return anything on the command line. It _does_ mount it, but nothing to std_out. I'd like it to mount through /etc/fstab so it's available every time after boot.
Is there a verbose mode or something I can turn on for mount?
Thanks again.

- Mac
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Nov 15, 2005 6:02 pm    Post subject: Reply with quote

If the partition is mounted you can do "mount" with no arguments to see the partitions that are mounted, along with their type and mount options.
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Tue Nov 15, 2005 6:06 pm    Post subject: Reply with quote

If I'm not mistaken, each filesystem's superblock has a different "magic number". I'm not exactly sure how that works but you may want to check the kernel's filesystem code or that of the specific filesyetem utilities. Hopefully that's a push in the right direction. :)

--Peter
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Tue Nov 15, 2005 9:34 pm    Post subject: Reply with quote

6thpink, you da man!

Code:
/dev/sdb2 on /mnt/stuff type ext2


So it is ext2.. but my /etc/fstab says ext3.. which is ext2 w/ journaling... and I think it shows up as ext2 sometimes, doesn't it?
Will it hurt the fs if I try mounting it as an ext2 w/ /etc/fstab?
Thanks. I'll be googling for partition magic numbers in the meantime. ;)

- Mac
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Nov 15, 2005 9:51 pm    Post subject: Reply with quote

Ext3/2 are fully compatible partition types. That means that you can mount any ext2 or ext3 wich any of this two types, and nothing bad will occur. Both are great, and as a rule of thumb you can use this: if that partition contain important data use ext3 (it is safer), while if this partition contains something that is not vital (like var, portage or tmp) you can live without journal, so use ext2 (that is lighter in resources and disk space, since it does not use journaling).

So, there is no problem in changing the type in fstab. If you want to transform your ext2 partition into ext3 you may want to do "tune2fs -O dir_index -j <partition>" to activate the dir_index feature and start a journal. Then change fstab to mount it as ext3. You will still be able to mount it as ext2 by specifying manually the type, as in "mount -text2 <partition> <mount_point>"

- Regards.
Back to top
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Tue Nov 15, 2005 10:02 pm    Post subject: Reply with quote

It is perhaps even ext3. But when you look into /proc/filesystems you see that the kernels tries to mount ext2 before ext3 so a ext3 partition is mounted as ext2 if you leave the choice to the kernel. Just add a "-t ext3" to the mount command to mount it explicitly as ext3.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Nov 15, 2005 10:17 pm    Post subject: Reply with quote

Exactly, you can also use fstab to fix ext3 as the type of that partition, then mount will always mount that partition under the directory that you select as ext3. For example:
Code:

/dev/hda /mnt/whatever ext3 noauto,noatime 0 0

That will cause "mount /mnt/whatever" to mount that partition in that directory with the type "ext3". You can always manually override that settings by using -text2.
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Wed Nov 16, 2005 3:34 am    Post subject: Reply with quote

Thanks a ton guy's, that really clears some things up for me.
Thanks again!

- Mac
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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