Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
when i use the mount command to mount an hdd to a mount point .. am i mounting the hdd as a whole or the partitions like hdd1 ?
It depends on what exactly you are doing.
If we speak about hard disks, then the usual thing is that they will contain partitions, so, you don't mount hdc, but hdc1, hdc2... and so on. You could format the whole disk without partitioning it, something that's not possible in other OSes, then you could mount it instead of mounting single partitions, but you usually don't do that. In linux you can even format a file and mount it as it was a disk.
On the contrary, when we speak about cdroms we mount the whole block device, and not a partition. So, if hdc is a cdrom, then we mount hdc itself, and not hdc1.
It just depends on how did you create the filesystem and that stuff.
If we speak about hard disks, then the usual thing is that they will contain partitions, so, you don't mount hdc, but hdc1, hdc2... and so on. You could format the whole disk without partitioning it, something that's not possible in other OSes, then you could mount it instead of mounting single partitions, but you usually don't do that. In linux you can even format a file and mount it as it was a disk.
On the contrary, when we speak about cdroms we mount the whole block device, and not a partition. So, if hdc is a cdrom, then we mount hdc itself, and not hdc1.
It just depends on how did you create the filesystem and that stuff.
Not to get too picky but!
When you allocate all the space on a hdd to a particular filesystem you must first create a partition on that device then create the filesystem of choice by formatting. To the OP, you should look at the complete 'man' pages for the commands.
Code:
excerpt from 'man fdisk';
NAME
fdisk - Partition table manipulator for Linux
SYNOPSIS
fdisk [-u] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device
fdisk -l [-u] [device ...]
fdisk -s partition ...
fdisk -v
DESCRIPTION
Hard disks can be divided into one or more logical disks called parti-
tions. This division is described in the partition table found in sec-
tor 0 of the disk.
In the BSD world one talks about `disk slices' and a `disklabel'.
Linux needs at least one partition, namely for its root file system.
It can use swap files and/or swap partitions, but the latter are more
efficient. So, usually one will want a second Linux partition dedicatedas swap partition. On Intel compatible hardware, the BIOS that boots
the system can often only access the first 1024 cylinders of the disk.
For this reason people with large disks often create a third partition,
just a few MB large, typically mounted on /boot, to store the kernel
image and a few auxiliary files needed at boot time, so as to make sure
that this stuff is accessible to the BIOS. There may be reasons of
security, ease of administration and backup, or testing, to use more
than the minimum number of partitions.
fdisk (in the first form of invocation) is a menu driven program for
creation and manipulation of partition tables. It understands DOS type
partition tables and BSD or SUN type disklabels.
fdisk doesn't understand GUID Partition Table (GPT) and it is not
designed for large partitions. In particular case use more advanced GNU
parted(8).
The device is usually one of the following:
/dev/hda
/dev/hdb
/dev/sda
/dev/sdb
Code:
excerpt from 'man mkfs';
NAME
mkfs - build a Linux file system
SYNOPSIS
mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [ blocks ]
DESCRIPTION
mkfs is used to build a Linux file system on a device, usually a hard
disk partition. filesys is either the device name (e.g. /dev/hda1,
/dev/sdb2). blocks is the number of blocks to be used for the file
system.
The exit code returned by mkfs is 0 on success and 1 on failure.
In actuality, mkfs is simply a front-end for the various file system
builders (mkfs.fstype) available under Linux. The file system-specific
builder is searched for in a number of directories like perhaps /sbin,
/sbin/fs, /sbin/fs.d, /etc/fs, /etc (the precise list is defined at
compile time but at least contains /sbin and /sbin/fs), and finally in
the directories listed in the PATH environment variable. Please see
the file system-specific builder manual pages for further details.
When you allocate all the space on a hdd to a particular filesystem you must first create a partition on that device then create the filesystem of choice by formatting.
Yes. Re-read my post. That's what you must do. But you can format the whole device without partitioning it, just like you format any other file without partitioning it to use it later as a loopback filesystem. That's why I said that
Quote:
You could format the whole disk without partitioning it [...] but you usually don't do that
.
To be more explicit, there's nothing stopping you from doing something like "mkfs.ext3 /dev/hda".
But the point I am seeing is that you do NOT have to set up any partitions.....
Mybe this will help (cyberiapost--are you still with us?):
You don't mount drives or partitions---you mount filesystems. The filesystem can exist on a partition, or it can exist on the whole drive--with no partitions.
The other semanticism* I find useful is to think of "mount" as "connect". When you say "mount /dev/sda2 myfiles", you are connecting the filesystem on /dev/sda1 to the "myfiles" node on the overall filesystem tree.
For the history buffs, note that "mount" comes from the old days when "mounting the filesystem" meant walking thru a bunch of racks, finding a tape, and physically mounting it on the tape drive.
But the point I am seeing is that you do NOT have to set up any partitions.....
Mybe this will help (cyberiapost--are you still with us?):
You don't mount drives or partitions---you mount filesystems.
That's the whole point that I wanted to make clear, though I probably failed at it. You said it all in one short and perfect sentence. The whole point I wanted to make clear is that it doesn't matter if it's a hard disk (hda), a partition (hda1), a cdrom (hda, scd0, or whatever) or a file on your disk (myimagefile.img). As long as it contains a file system it can be mounted.
If you know and understand that, then everything else becomes crystal clear, and you don't need to ask things like "do I mount hda or hda1?".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.