LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-14-2009, 02:36 AM   #1
Quads
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Fedora, Ubuntu, Slackware
Posts: 203

Rep: Reputation: 34
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.
 
Old 07-14-2009, 03:05 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 291Reputation: 291Reputation: 291
Quote:
Originally Posted by Quads View Post
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 View Post
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 View Post
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.

Last edited by tommcd; 07-14-2009 at 03:13 AM.
 
Old 07-14-2009, 03:37 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by Quads View Post
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,

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).
 
Old 07-14-2009, 08:40 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,183

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.

Last edited by sundialsvcs; 07-14-2009 at 08:43 AM.
 
Old 07-14-2009, 09:26 AM   #5
jspsandhu
Member
 
Registered: Dec 2004
Location: Slough, UK
Distribution: Fedora, FreeBSD, RHEL
Posts: 85

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

Cheers,
 
Old 07-14-2009, 09:26 AM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,029

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Quote:
Originally Posted by Quads View Post
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 View Post
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 View Post
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 View Post
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.

Last edited by schneidz; 07-14-2009 at 09:31 AM.
 
Old 07-14-2009, 11:27 PM   #7
Quads
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Fedora, Ubuntu, Slackware
Posts: 203

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by i92guboj View Post


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,
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?
 
Old 07-15-2009, 01:31 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by Quads View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Total Noob Question (Operating System vs File System) fuzzy1 Linux - Newbie 14 02-06-2009 11:33 AM
File System Question spaceballs Slackware 30 07-02-2008 02:10 PM
file system question mokku Linux - Newbie 7 10-09-2007 07:21 AM
File system question mrrrl Linux - Newbie 6 04-08-2004 03:54 PM
Question on File System and File Copying hey_joe Linux - Newbie 2 11-05-2003 11:30 AM


All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration