From: Peter Hanke on
How can I find out from cmdline terminal which filesystem (ext3, ext4, Reiser,
JFS, XFS, VxFS) is currently used on the local Linux system?

Does your suggested command work on all Linux distributions (Debian, Redhat,...) or even Solaris?

Assume I mount a second hard disc.
Can this second filesystem different from the filesystem of the first ("Main") hard disc?

Can filesystems be diffent even between partitions on the SAME hard disc?

Peter

From: pk on
Peter Hanke wrote:

> How can I find out from cmdline terminal which filesystem (ext3, ext4,
> Reiser, JFS, XFS, VxFS) is currently used on the local Linux system?

For Linux,

df -T

not sure other systems wupport -T though.

> Does your suggested command work on all Linux distributions (Debian,
> Redhat,...) or even Solaris?

See above.

> Assume I mount a second hard disc.
> Can this second filesystem different from the filesystem of the first
> ("Main") hard disc?

Yes, it can be different.

> Can filesystems be diffent even between partitions on the SAME hard disc?

Yes, and many times they are, although it doesn't necessarily have to be so.
From: Aragorn on
On Tuesday 27 July 2010 17:01 in comp.os.linux.misc, somebody
identifying as Peter Hanke wrote...

> How can I find out from cmdline terminal which filesystem (ext3,
> ext4, Reiser, JFS, XFS, VxFS) is currently used on the local Linux
> system?

The simplest way to tell is via "/bin/mount" and "/bin/df". See their
respective /man/ pages for details on commandline options. (Hint,
for "df" you need the "-T" option.)

An example of "df" output:

[17:09:16][localhost:/home/aragorn]
[aragorn] $> df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda2 reiserfs 393M 179M 214M 46% /
/dev/hda1 reiserfs 197M 38M 159M 20% /boot
/dev/hda3 reiserfs 9.8G 2.5G 7.3G 26% /usr
/dev/hda6 reiserfs 746M 33M 714M 5% /opt
/dev/hda7 reiserfs 2.0G 355M 1.6G 18% /var
/dev/hda8 reiserfs 298M 33M 266M 11% /usr/local
/dev/hda9 reiserfs 79G 2.4G 77G 4% /home
/dev/hda10 reiserfs 21G 3.2G 18G 16% /srv
none tmpfs 1014M 56K 1014M 1% /tmp

> Does your suggested command work on all Linux distributions (Debian,
> Redhat,...) or even Solaris?

All GNU/Linux distributions have the command "/bin/df" available. I
cannot speak for (Open)Solaris, but it would surprise me if it did not
have this very useful command available, or at the very least an
equivalent of it.

> Assume I mount a second hard disc.

While it is possible to apply a filesystem to a raw hard disk device
without creating partitions on it, this practice is generally advised
against and not used. Therefore, one generally does not mount a hard
disk; one mounts partitions on hard disks instead.

> Can this second filesystem different from the filesystem of the first
> ("Main") hard disc?

Of course. GNU/Linux supports many different filesystem types, some for
both reading and writing, others for reading only, and you can easily
have different filesystem types on different partitions. That's one of
the many possibilities offered by a segregation of the contents of
certain root-level directories onto other partitions.

How else would a GNU/Linux (or any other UNIX-family) system mount a
CD-ROM, a DVD-ROM, a floppy disk, a USB thumbdrive or even a RAm-based
filesystem - and there are several of those too - for that matter, if
the use of different filesystems and different storage devices were not
possible?

> Can filesystems be diffent even between partitions on the SAME hard
> disc?

Of course they can - see the above paragraph. The Linux kernel doesn't
care what disk a partition or filesystem is on - and not even what
machine, for that matter - nor what the on-disk filesystem is.

All filesystems are mounted into a unified directory tree in the virtual
filesystem layer, and filesystems that do not support the UNIX/POSIX
file ownerships and permissions - e.g. vfat, ntfs, hpfs - are given an
emulated set of those in the virtual filesystem layer at mount time,
either from the commandline or via said filesystems' respective records
in "/etc/fstab".

Of course, in the event of a non-POSIX-compatible filesystem, the
permissions and ownerships cannot be changed while the filesystem is
mounted - as again: they are set at mount time - and it is also not
possible to write POSIX ownership and permissions information to such
non-POSIX-compatible physical filesystems on their physical media.
(Note: The old "umsdos" mechanism, which was a special way of dealing
with "msdos" filesystems - known as "FAT12/16" to DOS, OS/2 and Windows
users - was capable of storing that information inside files which for
said three platforms were considered "hidden", but support for "umsdos"
was dropped from the Linux kernel a while ago.)

--
*Aragorn*
(registered GNU/Linux user #223157)
From: Aragorn on
On Tuesday 27 July 2010 17:37 in comp.os.linux.misc, somebody
identifying as Aragorn wrote...

> On Tuesday 27 July 2010 17:01 in comp.os.linux.misc, somebody
> identifying as Peter Hanke wrote...
>
>> Assume I mount a second hard disc.
>
> While it is possible to apply a filesystem to a raw hard disk device
> without creating partitions on it, this practice is generally advised
> against and not used. Therefore, one generally does not mount a hard
> disk; one mounts partitions on hard disks instead.

Or, as is becoming more prevalent even on computers used at home, one
might be mounting a logical volume in a volume group inside a
partition. ;-)

Logical volumes are an abstraction layer above the physical partitioning
layout. One generally creates a large partition using "/sbin/fdisk" or
a similar tool, and then one creates a volume group inside the
partition. And then, one can create multiple logical volumes inside
said volume group and format those with a filesystem of one's choice,
or even create a swap volume as a logical volume.

Logical volumes are more easily resizeable than regular disk partitions
and offer extended functionality, such as creating snapshots. The two
most commonly used logical volume management technologies are IBM's
EVMS and LVM2, with the latter being the preferred one in GNU/Linux,
albeit that EVMS is also supported. (The two are not compatible
though, so if you opt for logical volume management, then you should
use one or the other.)

HowTos are available at http://www.tldp.org.

--
*Aragorn*
(registered GNU/Linux user #223157)
From: Chris Davies on
Peter Hanke <peter_ha(a)andres.net> wrote:
> How can I find out from cmdline terminal which filesystem (ext3,
> ext4, Reiser, JFS, XFS, VxFS) is currently used on the local Linux
> system?

The pseudo-file /proc/filesystems will show you the set of filesystems
that are available in your running kernel. The mount command will show
you the filesystem(s) currently in use.


> Does your suggested command work on all Linux distributions (Debian,
> Redhat,...) or even Solaris?

To my knowledge, /proc/filesystems is available within all Linux
distributions. It is not available on any flavour of Solaris, and I
don't know how one could determine set available set of filesystems
there. The mount command, on the other hand, is a standard UNIX command
and is available on all platforms.


> Assume I mount a second hard disc.
> Can this second filesystem different from the filesystem of the first
> ("Main") hard disc?

Yes. When you run the "mount" command you will see there are several
different types of filesystem already in use.


> Can filesystems be diffent even between partitions on the SAME hard disc?

Absolutely yes.

Chris