LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File system question... (https://www.linuxquestions.org/questions/linux-newbie-8/file-system-question-739913/)

Quads 07-14-2009 01:36 AM

File system question...
 
If I were to install a hard drive in my machine that had been partitioned and formatted using a totally unrecognizable file system, how would linux react to that? Would the drive still be recognized as /dev/hdx or /dev/sdx? Or would it simply ignore it?

If the system sees a new drive on boot, and the drive has a partition, does it attempt to automatically mount the partition? Or does it leave that for the user?

Do all filesystems use the same framework for partitioning? What I mean is if I take an ext3 drive and plug it in a machine running windows, will windows know there is a partition on that drive, or will it not recognize it because cannot natively use the ext3 filesystem? I guess the question really is, are the partitions the same and the formats different, or are the partitioning methods themselves different?

I know this may seem like a bunch of totally off-the-wall rambling questions. Sorry. ;)

tommcd 07-14-2009 02:05 AM

Quote:

Originally Posted by Quads (Post 3606872)
If I were to install a hard drive in my machine that had been partitioned and formatted using a totally unrecognizable file system, how would linux react to that? Would the drive still be recognized as /dev/hdx or /dev/sdx? Or would it simply ignore it?

Linux will still list the drive as /dev/sdX or /dev/hdX, where X = the letter of the drive (e.g.:/dev/sda, /dev/sdb, /dev/sdc, etc). This should still be the case even if linux can not read the filesystem on the drive.
Quote:

Originally Posted by Quads (Post 3606872)
If the system sees a new drive on boot, and the drive has a partition, does it attempt to automatically mount the partition? Or does it leave that for the user?

As far as I know, most distros will not automatically mount the partitions on the drive. You will have to create mount points for the partitions on the drive that you want to mount and then mount them with the mount command. To have them mount automatically on bootup you will need to add them to your /etc/fstab file.
Quote:

Originally Posted by Quads (Post 3606872)
Do all filesystems use the same framework for partitioning? What I mean is if I take an ext3 drive and plug it in a machine running windows, will windows know there is a partition on that drive, or will it not recognize it because cannot natively use the ext3 filesystem? I guess the question really is, are the partitions the same and the formats different, or are the partitioning methods themselves different?

Windows does see linux partitions, but it calls them "unknown partition", or something like that. Windows (at least Windows XP which I have) will not read linux file systems. I am pretty sure this is the case with Vista as well.

i92guboj 07-14-2009 02:37 AM

Quote:

Originally Posted by Quads (Post 3606872)
If I were to install a hard drive in my machine that had been partitioned and formatted using a totally unrecognizable file system, how would linux react to that? Would the drive still be recognized as /dev/hdx or /dev/sdx? Or would it simply ignore it?

The drive will be recognized as long as it's attached to a controller that the kernel can handle, might it be via scsi/sata/usb-storage, IDE, or whatever.

How the drives and partitions will be called will only depend on the driver that is handling the device. Devices handled trough the scsi layer, including sata, usb and pata drives will be named as sd*, scsi cdroms will be named as scd*, drives handled through the ide/ata/mfm/rll stuff will be named as hd*.

Partitions are numbered from 1-4 for the four possible primary ones on each disk, and from 5 and up for the logical drives that you can possibly have inside an extended partition.

This stuff is done *before* the fs drivers come into scene, so it really doesn't matter what kind of fs's are there inside the drive.

Quote:

If the system sees a new drive on boot, and the drive has a partition, does it attempt to automatically mount the partition? Or does it leave that for the user?
Not usually, it wouldn't know where to mount it in any case. You can write udev rules to automount a given device automatically when it's plugged though. Some other tools relate to this, though I highly discourage them because they gave me nothing but pain, like pmount and ivman.

Quote:

Do all filesystems use the same framework for partitioning? What I mean is if I take an ext3 drive and plug it in a machine running windows, will windows know there is a partition on that drive, or will it not recognize it because cannot natively use the ext3 filesystem? I guess the question really is, are the partitions the same and the formats different, or are the partitioning methods themselves different?
Partitions are just partitions, if windows can't detect their format, it will usually assume that it's not formated and offer you the option to format it. Such is windows, :p

There are other partitioning schemes, and in fact linux can run without a partition (you could format sda just like you format sda1, and you can even format a regular file and use it as a loopback filesystem).

sundialsvcs 07-14-2009 07:40 AM

In some cases, (e.g. when the fstab entry specifies autofs), Linux may be able to determine what filesystem format has been used on a drive by inspection of the data.

This is described at great length in man mount, which very aptly concludes, "if you data is valuable, don't ask mount to guess." :)

It is worthy to note that both OS/X and Microsoft Windows provide a similar capability. All of them support installable filesystems, and provide many vendor and third-party drivers.

jspsandhu 07-14-2009 08:26 AM

Try this page for dual boot installs should help :-
http://linuxzone.5u.com/dboot.html

Cheers,

schneidz 07-14-2009 08:26 AM

Quote:

Originally Posted by Quads (Post 3606872)
If I were to install a hard drive in my machine that had been partitioned and formatted using a totally unrecognizable file system, how would linux react to that? Would the drive still be recognized as /dev/hdx or /dev/sdx? Or would it simply ignore it?

the system will know there is a physical hd on an ide or sata port and will assign /dev partitions to it. when you issue a mount command you will get errors.
Quote:

Originally Posted by Quads (Post 3606872)
If the system sees a new drive on boot, and the drive has a partition, does it attempt to automatically mount the partition? Or does it leave that for the user?

if you go to bios setup before the os starts, it should list all avavilable floppy/ cd/ dvd/ hard/ usb drives that it sees and ask you which order you would like to boot in.
Quote:

Originally Posted by Quads (Post 3606872)
Do all filesystems use the same framework for partitioning? What I mean is if I take an ext3 drive and plug it in a machine running windows, will windows know there is a partition on that drive, or will it not recognize it because cannot natively use the ext3 filesystem? I guess the question really is, are the partitions the same and the formats different, or are the partitioning methods themselves different?

be careful of plugging in a usb drive into windows with a format that it cant read; it will provide you a pop-up saying it is not formatted and to click yes to format (data loss).
i think partitions across the board are the same. the first sector of a drive contains a partition table that details the type, size, location and geometry of each partition on the drive.
Quote:

Originally Posted by Quads (Post 3606872)
I know this may seem like a bunch of totally off-the-wall rambling questions. Sorry. ;)

some of the best conversation is in result of off-the-wall rambling.

Quads 07-14-2009 10:27 PM

Quote:

Originally Posted by i92guboj (Post 3606936)


Partitions are just partitions, if windows can't detect their format, it will usually assume that it's not formated and offer you the option to format it. Such is windows, :p

So the physical placement of the partition on the drive is the same for all file systems? For example, an ext3 partition and an NTFS partition only differ in the way they are formatted, not in the actual framework containing the format?

i92guboj 07-15-2009 12:31 AM

Quote:

Originally Posted by Quads (Post 3607937)
So the physical placement of the partition on the drive is the same for all file systems? For example, an ext3 partition and an NTFS partition only differ in the way they are formatted, not in the actual framework containing the format?

*Almost* all the work that fdisk (or whatever tool you choose) does, is on the MBR (master boot record). Which is contained within the first 512 bytes of a given disk (the first sector). That's outside -just in front- of the first partition.

The MBR holds a number of things, depending on the system. Amongst them, the partition table. This starts at 1be hex, or the 446th byte in decimal, and it takes up to 510 (64 bytes). This table defines the *primary* partitions, and where do they start and end. Each primary partition takes 16 bytes on this table, and that's why you can only have four of them.

One of this partitions can be an extended partition, and in this case, there will be a secondary boot record in front of the extended partition inlined in the disk format. It's a standard as well, and it doesn't matter at all what's inside the partition(s). The fs driver will worry about that at a later stage. At the current stage, our OS is just counting partitions.

You need to understand that fs's live *inside* the partitions, just like files really. In fact, you could consider a fs like a file with a very specific internal format, that can contain other files inside of it.

Partitions do not know anything about fs's, and they don't need either. The OS needs to be able to identify and attack the partitions to a device node *before* looking for an fs. Otherwise, you wouldn't even be able to format the partition in first place, think about it...


You should check these:

http://en.wikipedia.org/wiki/Partition_table
http://en.wikipedia.org/wiki/Master_boot_record
http://en.wikipedia.org/wiki/Extended_partition

For a starter. ;)


All times are GMT -5. The time now is 09:34 AM.