LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-23-2008, 08:55 AM   #1
amredries
LQ Newbie
 
Registered: Nov 2008
Posts: 10

Rep: Reputation: 0
Unhappy hard disk browse



in old days when we used to have DOS and we have 2 or more partition we go through it by using "c: and enter" to go drive C or "d: and enter" to go drive D and so on

Can anybody tell me plz how i can do that in Linux
 
Old 11-23-2008, 09:00 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You need to mount the partitions. Read the man page for mount for details on how to do so. Once you've mounted the partitions (on different directories, obviously), you can just cd to those directories as normal.

Edit: it might help if you told us which distro you're using. Some automatically mount partitions for you.

Last edited by Nylex; 11-23-2008 at 09:02 AM.
 
Old 11-23-2008, 09:12 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Well...we still have DOS, but why would anyone use it when there is Linux?...

I would advise you to learn directly how to do things in Linux and not try to find the equivalents for specific DOS tricks. The Unix/Linux methods are vastly more powerful, and if you simply try to extrapolate from DOS, you'll miss all the good stuff.

Personally, I am eternally grateful that I never learned DOS---by the time I got a PC, Windows was the norm. Concurrently, I had learned some Unix and--when finally switching over to Linux, everything fell into place.
 
Old 11-23-2008, 09:13 AM   #4
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by amredries View Post
in old days when we used to have DOS and we have 2 or more partition we go through it by using "c: and enter" to go drive C or "d: and enter" to go drive D and so on

Can anybody tell me plz how i can do that in Linux
There are no drive letters in linux.
You have to mount partitions/drives to access them. see "man mount" for more info.
 
Old 11-23-2008, 01:09 PM   #5
amredries
LQ Newbie
 
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Smile Next step

thanks guys for help

but after mounting what should I do?
 
Old 11-23-2008, 01:11 PM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Whatever you like. Can you be more specific about the problem?
 
Old 11-23-2008, 04:05 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
There certainly is some jargon here that may be unfamiliar to a Windows user.

First, "mount" can be thought of as "connect". Technically, what you are doing is connecting the partition's filesystem to the main directory tree. Once you do that,you can then browse to the partition using your GUI file manager, or "CD" to it in a terminal.
 
Old 11-23-2008, 04:38 PM   #8
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Linux views everything as files including disk partitions, devices, programs, etc. When a disk is partitioned in Windows the disk is assigned a Drive letter for reference (C:, D:, etc.) In Linux a partition is identified by a device name such as /dev/sda1 (1st drive, 1st partition) or /dev/sdb2 (2nd drive, 2nd partition). Linux drive partitions are then assigned directory names by mounting the partitions. For example /dev/sda1 is usually mounted as "/" which is the base directory, /dev/sdb2 may be mounted as /mnt/backup or /mnt/mirror or /mnt/disk2 or whatever you wish to use to refer to it.

When you browse disks in Linux you browse directories and files and the primary command for looking at the directory is:
Code:
ls
Linux commands use -flags to change the output of a command or how the command operates. These flags can be used individually or you can use more than one flag at a time. For example, to see a long listing of the ls command you would use the command:
Code:
ls -l
A long listing including all hidden files (those that begin with a [.] you would enter:
Code:
ls -la
Built into Linux are manual pages for each and every command. To see the options that are available for the ls command you would enter:
Code:
man ls
and this will list the manual page for your command.
You can also get help on any command by typing:
Code:
command --help
So to get help on the ls command you would type:
Code:
ls --help

Last edited by AuroraCA; 11-23-2008 at 04:40 PM.
 
Old 11-23-2008, 04:57 PM   #9
mohaas05
Member
 
Registered: Oct 2008
Posts: 41

Rep: Reputation: 16
Partitions, in filesystem terms, are invisible. That is even if you have say, /home on another drive, it will always be /home rather than C:\home or D:\home like in DOS.

To mount a new drive, you use the mount command in this format:

mount [device] [directory to mount in]

So say you want to mount the drive /dev/hdb1 in the directory /disk2. You need to create that directory /disk2 with mkdir, then mount the drive in that directory with mount:

mount /dev/hdb1 /disk2

Now, when you navigate to /disk2, you will be able to access the entire drive.
 
Old 11-23-2008, 05:11 PM   #10
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by AuroraCA View Post
...
//offtopic
Guys, sorry to interfere, but I think some of you overdoing it. OP didn't request much of additional info, and some of you are already writing "dissertations" about mount. Is it worth it? It won't be effective if OP didn't need additional information you provided (and spent time typing). Also and "man mount" explains most of things.
 
Old 11-23-2008, 05:24 PM   #11
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
OP stated that he/she is a new Linux user and relates to Windows. My post was intended to explain in context to Windows what the equivalent of browsing files would be.

Besides, it's my time to waste.
 
Old 11-24-2008, 07:00 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
<<continuing off-topic>>
I find myself unconsciously guessing how much info will be useful to the OP. If I sense that it will be useful, I too will get verbose sometimes.

In this case, OP seemed thoroughly lost, but also posted follow-up. To me, that's a signal that verbose mode might be useful.
 
Old 11-24-2008, 07:39 AM   #13
amredries
LQ Newbie
 
Registered: Nov 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Smile Thank you

thank you all guys for your help
 
Old 11-24-2008, 08:10 AM   #14
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by amredries View Post
thank you all guys for your help
See!!! He appreciates the verbosity...

Seriously--amredies; thanks for the follow-up
 
Old 11-24-2008, 11:32 AM   #15
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Verbosity is not necesarily a bad thing.

We could have told him to do "mkdir /mnt/sda1; mount /dev/sda1 /mnt/sda1" on the first post. But he would still have no clue on what's going on.

The main problem when coming from Windows is that the posix filesystem paradigm is way too different to the DOS/Win scheme. On a tipical posix filesystem, like the traditional linux filesystems, there are no "drives" in the same sense that you find them under Windows or DOS. Instead you have a root, which is represented as a slash (/), from that root (that might not even reside on a physical disk), different filesystems are attached. Some of them doesn't live on any concrete disk either, like /proc, some others are created at startup and do not contain regular files, like /dev.

Additional disks can be attached to our live filesystem at any given moment. So, your /dev/hda1 (first IDE disk, first primary partition) can hold the contents of your root filesystem, and then you can "mount" /dev/hda2 (first hard disk, second primary partition) to /home/. Simple as that. Once mounted on a given point of your directory structure, you can enter that disk by just doing cd to the directory where you mounted it. Disks and similar devices can be attached to your already existing file system and the kernel will take care about the "which device goes this into?" part. Applications just see directories, and don't care about the rest.

If in Win you used to link "My documents" to D:, in Linux you could mount /dev/hdb2 (or whatever) into /home, and cd home instead (or browse it with a graphical browser). Different graphical environments do this in different ways. That's why we use the command line terminology, because it's the most standard way and doesn't depend on a given desktop. Some desktops like kde try to make and abstraction to make this seem more like in Windows, however the underlying system is still the same and knowing this stuff never hurts.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting linux files from another hard disk(IDE) to current hard disk(sata) the lord protector Linux - Hardware 5 05-04-2008 11:30 AM
Now I have a scsi hard disk, two IDE hard disk, i want install linux on scsi hard dis tecpenguin Linux - Server 4 11-10-2007 06:44 AM
SATA Hard disk(Windows) MBR corrupted by IDE hard disk(Linux) Peter_APIIT Fedora 6 07-07-2007 12:20 AM
Can I use a virtual machine hard disk as a real hard disk, or vice versa? onlineapps Linux - Software 1 02-24-2007 08:40 PM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:30 AM.

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
Open Source Consulting | Domain Registration