understanding partitioning

Amedee Van Gasse amedee-ubuntu at amedee.be
Mon Oct 31 13:33:07 UTC 2011


On Sun, October 30, 2011 17:47, Linux Tyro wrote:
> On Sun, Oct 30, 2011 at 6:34 PM, Avi Greenbury <lists at avi.co> wrote:
>
> But files have more than just data - they have things like names, and
>> modified
>> dates and permissions. We therefore tend to use a filesystem on a
>> drive.
>>
>
> But those files which have names, etc.. that all are also stored in the
> form
> of '0' and '1' only?

Yes.

>> A filesystem basically sets out a standard for the way files are
>> to be stored on a drive - how the filename is stored and linked to the
>> file, and how the permissions work. Common filesystems in Windows are
>> NTFS and FAT, and Linux tends to use ext3 or ext4. The actual mechanics
>> of how they work isn't particularly important, but the reason that,
>> say, Windows needs a different partition to Linux us because Windows
>> assumes NTFS's way of storing permissions and other file data, and
>> Linux assumes ext's. [0] You would, therefore, put Windows on an NTFS
>> filesystem in one partition, and Ubuntu on an ext filesystem in another.
>>
>
> Okay, but one exciting this is that from Linux, we can see the Windows,
> i.e.
> from ext 4 we can use NTFS systems but not vice-versa, is it like that?

Yes.
Think of FAT, NTFS, ext3 and ext4 as languages.

Windows' mother language is NTFS. It also knows one other language that it
used to speak in the past: FAT. Windows does not want to learn other
languages, because he feels soooo important and because he never leaves
his country, so why should het learn other languages?

Linux's mother language is ext. It comes in 3 different dialects: ext2,
ext3, ext4. But Linux is a polyglot and travels all over the world. It has
over the years learned to speak lots of other languages: Reiser, XFS, JFS,
btrfs, and even Windows' NTFS and FAT.

>> In contrast to Window's way of exposing hard drives with drive letters,
>> Linux lets you 'mount' any drive at any directory. To 'mount' a drive
>> is to make it available under a directory. If you had a big disk full
>> of music, for example, you might wish to mount it under the directory
>> 'music' in your home directory, then you just go into that directory to
>> access the files on the disk.
>>
>> /dev/ is a directory in which devices are 'kept'. To mount a drive, you
>> need to specify which device you want mounted (using its /dev address)
>> and which directory you want it mounted on.
>>
>
> Devices means hard drive partitions or separate usb drives (external
> device(s))?

Devices has multiple meanings.
It's physical devices: the actual things that you can hit with a hammer.
And logical devices: an abstract concept that is used by Linux.
Partitions are logical devices that are made "on top of" physical devices
(drives).

Actually, software that runs on top of Linux only talks to logical
devices, and the Linux kernel translates this to the actual physical
devices. And vice versa.

> To mount a drive, we need device name (like.../dev...?)
> [device
> means, partition name..?) to which we want to mount? And if we mount, we
> mount in a directory (no other possibility) and thus make it accessible
> such
> that by going to that directory, we can actually open and use it.., is it
> like that?

Yes.

>> /dev isn't reserved for disk drives, though. Disk drives generally
>> start /dev/sd nowadays.
>>
>
> Didn't understand this, you are saying /dev isn't reserved for disk drives
> and then, now a days, starting from /dev/sd*...?

"/dev/" isn't used.

>> /dev/sda is the first drive, /sdv/sdb the second and so on.
>>
>> The partitons are then themselves denoted by letters:

I think he meant numbers.

>> /dev/sda1 is the first partition on the first drive, /dev/sda4 the
>> fourth. You cannot actually *do* anything to the drives with these
>> addresses - if you want to get at the files on them you need to
>> instruct Linux to mount them first. Fortunately, it probably already
>> has.
>>
>
> Didn't get this... Please a little bit explain. Thx. If you say, I can
> post
> my output of any command (you tell me), if this way I can know!

A few paragraphs ago you understood it already?

Look, you put a hard disk in a computer.

Linux calls the hard disk "/dev/sda", or just "sda" if you don't want to
type everything. With a letter a because it is the first disk. The second
disk would be "/dev/sdb", the third "/dev/sdc" and so on.
You partition sda.

First partition is /dev/sda1. Second partition is /dev/sda2. And so on.
Do you really NEED partitions? No. But it is good practice to make a
/dev/sda1 partition anyway, even if it is the only partition.

So now you have /dev/sda1, /dev/sda2, /dev/sdb1, /dev/sdb2 and so on. You
cannot yet "use" them = make them available in the filesystem so programs
know where to write. This is called mounting. Just like mounting a horse:
you cannot ride a horse if you haven't mounted it.

So you say, dear Linux, please mount this device on that directory:
mount /dev/sdb1 /media/music

Now you can copy your entire music collection to the directory /media/music.

>> I'm not aware of a graphical way to investigate what's mounted on the
>> computer, though I'm sure there is one, but you can get an idea if you
>> open a terminal (ctrl+alt+t) and then enter this text and hit enter:
>>
>> mount
>>
>> You will see several virtual drives mounted (ones with lines that don't
>> start '/dev/') but you should be able to pick out the ones that are
>> real-life drives. The lines are of the form:
>>
>> /dev/sda6 on / type ext3 (rw,errors=remount-ro,commit=0)
>>
>> This is /dev/sda6 (that is, the sixth partition of the first drive)
>> Mounted on / (that is, the 'root' directory, so it's where my operating
>> system is)
>> Of type ext3 (so the filesystem I'm using is ext3)
>>
>> The bits in the brackets are options for mounting, which are likely to
>> be different, but are rather boring and irrelevant here anyway,
>>
>>
>> > -LVM yet another thing, is related with what...? It is (also) a
>> > partition or what....? It is sda...?
>>
>> LVM is rather more complicated, at least until you're happy with
>> partitions and mounting and the like. Unless you've need to know and
>> use it shortly, it would be beneficial to get quite comfortable with
>> filesystems, partitions and the like before exploring LVM.
>>
>
> Correct, LVM, I am forgetting right now.

Good idea.

>> We speak of mounting drive at directories, and you make the contents
>> of the drive appear as the contents of the directory. Any previous
>> contents of that directory still exist, but are inaccessible while the
>> drive is mounted.
>> <https://lists.ubuntu.com/mailman/listinfo/ubuntu-users>
>>
>
> Inaccessible while the drive is unmounted or mounted?

unmounted = inaccessible
mounted = accessible





More information about the ubuntu-users mailing list