0

When I attach an SD card with multiple partitions to a Debian computer for example and use the mount command to mount a partition to the file system without specifying the file system type, which file system is used by default?

Take the below command for example :

mount /dev/sdb1 /media/mycardpart

How will the partition be accessed? I'm guessing by using EXT4 format by default because the rest of the file system uses this , but what if that partition has a different file system?

  • mount will automatically detect the filesystem. So there's no default filesystem. If it's not an ext4 filesystem, you can't mount it as ext4. EXT4 is the type of a filesystem. It's the already exist filesystem is of a certain type, not you can choose to access it using some type. – 炸鱼薯条德里克 Feb 25 at 12:48
2

The default filesystem used will be the filesystem of the respective partition which you're mounting.

In your example case /dev/sdb1.

Irrespective of the system's default filesystem ext4 (since you mentioned) Linux systems (Debian included) will find the partition's filesystem and mount it. However, some filesystem support need to have been compiled in the kernel. But for most commonly used filesystems such as FAT16, FAT32, NTFS ..... kernel support is on by default.

Follow-up

As to your first question:

It finds the filesystem type from the partition table. Partition table is something like contents of a book where you'll have headings, sub-headings, figures etc., listed at the beginning. partition table will have information such as number of partitions, size of each partition, beginning and end point information for each partition and type of each partition along with the file-system of each partition. mount reads the file-system information from this partition table. There are quite a few partition table formats MBR, GUID, APT etc., Ability to read and understand the partition table formats has to be enabled in the kernel (by default ext filesystems and few of MS filesystems are enabled in the kernel). Ability to mount, read and write special filesystems such as Amiga Fast File Systems require ability to read amiga partition table format which has to be either compiled in or to be loaded as module in to the kernel.

For the second question:

If a partition doesn't have a filesystem because it was not formatted, it will be shown as non-formatted free-space which can be formatted to any file-system of interest.

  • Ok thanks. How does it find the file system information of the partition tho? Also, what happens if the partition actually doesn't have a file system? – Engineer999 Feb 25 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.