LinuxQuestions.org
Visit Jeremy's Blog.
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 09-11-2006, 06:42 AM   #1
svin
Newbie
 
Registered: Jun 2005
Location: India
Posts: 10

Rep: Reputation: 0
Equivalent of D, E drives in Linux?!


Hi all,
I'm just migrating from windows to linux and hence have a 'windows way' of thinking! So, please bear with me if I say something really stupid. Also spare this long post!

Usually in books/documents that I've read or as I have done in my winxp-redhat 8 dual boot system, we create two partitions.
i)swap partition-double the RAM
ii)root partition-rest of the available free space.

Is this same as having a single C: drive in windows. In that case is that safe? Don't we have equivalents of D:, E: drives in linux?

The reason I'm asking this question is, In my pc(or in any of the pcs where I have installed windows) I usually partition as below:
i) C drive: to install OS and only imp. SWs from trusted source.
ii) D drive: to install any other SWs or games & to store data that I intend to burn to CDs/DVDs so that I can find them easily.
iii) E drive: all other data, pictures, songs/movies etc.

With this partitioning, in case windows crashes, I can format only C drive and install the OS. My personal data on other drives will be safe. This way, isn't it risky to have a single root partition?

I'll be obliged even if you help me with proper search words or links.

Thanks.
 
Old 09-11-2006, 06:47 AM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
Just Backup your /home/username
and if you reinstall just replay this folder again.
This is the easiest way.
Forget that C,D,E structure.

AND I know there WILL be millions of post after mine that will explain you
whatever and they are all correct ;-)
 
Old 09-11-2006, 06:52 AM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
The same thing can be done in Linux, but partitions are mounted at mount points instead of having drive letters. For example, you will have a root partition (mounted at /) which is the root of your file system and you will probably have a swap partition.

It's good practice to have a partition mounted at /home - it will hold your settings and data. Depending on what the box is used for you may break it up to have partitions mounted at /usr/local, /usr, /opt, /tmp, /var or others. There are almost as many ways of doing this as there are Linux administrators. At its simplest, you may just stick with a root partition and a swap partition...
 
Old 09-11-2006, 07:02 AM   #4
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
You have partitioned before, keeping OS apart from userdata. This is a good habit, I suggest you stick to it! (And congratulations, not many Windows-users understands the benefits with several partitions!)
As gilead says, instead of D, E etc you create partitions as you find best, then mount them.
(Actually, I do wonder what books you've read? Creating several partitions is the preferred way in Linux, recommended in all books/mags I've read.)
To "copy" your Windows-setup:
(C:\): /
(D:\): /usr/local or /opt are the most common places.
(E:\): /home
 
Old 09-11-2006, 07:24 AM   #5
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by svin
In that case is that safe? Don't we have equivalents of D:, E: drives in linux?
Linux doesn't use labels such as C: D: E:

Under Linux, everything appears under the same directory tree structure, but may include many partitions across many disks.

Eg: 'ls -l /' gives me:
Code:
drwxr-xr-x   2 root bin  4096 2006-01-02 15:59 bin/
drwxr-xr-x   2 root root 4096 2006-09-10 18:15 boot/
drwxr-xr-x  14 root root    0 2006-09-11 19:19 dev/
drwxr-xr-x  45 root root 8192 2006-09-11 19:19 etc/
drwxr-xr-x   5 root root   38 2006-04-24 20:06 home/
drwxr-xr-x   5 root root 4096 2005-06-06 13:41 lib/
drwxr-xr-x  15 root root 4096 2006-07-14 19:09 mnt/
drwxr-xr-x   8 root root   97 2006-04-28 21:46 opt/
dr-xr-xr-x  95 root root    0 2006-09-12 05:18 proc/
drwx--x---   5 root root  150 2006-08-20 20:36 root/
drwxr-xr-x   2 root bin  8192 2006-01-02 16:00 sbin/
drwxr-xr-x  11 root root    0 2006-09-12 05:18 sys/
drwxrwxrwt  10 root root  220 2006-09-11 21:56 tmp/
drwxr-xr-x  18 root root 4096 2006-07-23 18:41 usr/
drwxr-xr-x  16 root root 4096 2006-04-22 08:43 var/
This looks like a pile of directories on one partition. It isn't. This is verified by the 'mount' command:
Code:
/dev/sda2 on / type xfs (rw)
/dev/sda3 on /mnt/spare type jfs (rw)
/dev/sda4 on /home type xfs (rw)
/dev/sdb2 on /usr type xfs (rw)
/dev/sdb3 on /var type xfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /tmp type tmpfs (rw,size=1000m)
usbfs on /proc/bus/usb type usbfs (rw)
As you can see, here we have two hard disks - sda and sdb. They are partitioned thus:

sda:
sda1 swap
sda2 /
sda3 /mnt/spare
sda4 /home

sdb:
sdb1 swap
sdb2 /usr
sdb3 /var

Under Linux, partitions are treated as directories. If I am in the root directory and type 'cd /usr' I will have moved from sda2 to sdb2.

When you install Linux, it will ask you how you want to partition your disk. How you do it is entirely up to yourself, but I would at least put /home on its own partition, with possibly another partition for /mnt/data or something.

Also, you would benefit from understanding how the Linux Filesystem Hierarchy works:

http://www.pathname.com/fhs/pub/fhs-2.3.html

It may seem like a lot to read, but will definitely help you understanding the placement of files and organisation of Linux.

Have fun!
 
Old 09-11-2006, 07:36 AM   #6
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
You have partitioned before, keeping OS apart from userdata. This is a good habit, I suggest you stick to it! (And congratulations, not many Windows-users understands the benefits with several partitions!)
Well there lies a problem too; setting a fixed-size /home partition (or any other) might result in a full partition one day. Today, luckily, we can use stuff like LVM groups to get rid of the problem (and possibly add more space to /home even if we don't want to grow the partition size, like when adding another harddisk). So, today having separate partition for /home (especially) has its benefits, even more than it used to in the past.

I don't know if Windows is capable, or will be in it's next release (if it's ever released), to grow a drive (like C, if they stick to that concept) over a physical partition or drive. That's again one thing where Linux has evolved and Windows not. Forgetting the "drive structure" of Windows is essential when dealing with Linux/Unix'es since in addition to the normal methods there are available many ways of handling the data saved to a harddisk (or flash memory etc.), one big thing being the difference of physical and virtual filesystems (was that the right word?)

Another thing which is good to know is that you can mount any physical drive in (at least almost) any place of the filesystem; you can think the difference like this: Windows does not allow you (as far as I know) to add a new harddisk as a folder under your "My documents" folder. In Linux you can add (mount) your USB stick, another harddrive or any media under your home directory, for example, if you like. Mounting filesystems into special places like in the previous example gives benefits, if it's done wisely. So no need to add all those filesystems directly under root, or under /media or /mnt, if you don't like.
 
Old 09-12-2006, 04:48 AM   #7
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by b0uncer
So, today having separate partition for /home (especially) has its benefits, even more than it used to in the past.
No disagreement here.
Quote:
Originally Posted by b0uncer
I don't know if Windows is capable, or will be in it's next release (if it's ever released), to grow a drive (like C, if they stick to that concept) over a physical partition or drive. That's again one thing where Linux has evolved and Windows not.
Sorry to burst your balloon, but Microsoft have had this capability in Windows since W2K:

http://en.wikipedia.org/wiki/Logical_Disk_Manager
Quote:
Originally Posted by b0uncer
Another thing which is good to know is that you can mount any physical drive in (at least almost) any place of the filesystem; you can think the difference like this: Windows does not allow you (as far as I know) to add a new harddisk as a folder under your "My documents" folder.
No, but you can add disks to a "spanned volume" (Microsoft speak for striping).

http://support.microsoft.com/?kbid=308424
 
Old 09-12-2006, 08:38 PM   #8
svin
Newbie
 
Registered: Jun 2005
Location: India
Posts: 10

Original Poster
Rep: Reputation: 0
Thank u all for guiding me.

Thank u pingu for giving me 'linux equivalent of C:, D:, E:,...' ;-)

Thank u rkelsen for explaining the concept with live examples and for that useful link. It is a lot of information to read but I've fallen in love with Linux and hardwork doesnot scare me.

Thanks also to b0uncer for encouraging me to ask more.

Yesterday I stumbled upon 'Linux Partition HOWTO' by Kristian Koehntopp & Tony Harris. I wonder why I did not get to this page before. May be I used wrong search words.
 
  


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
telnet equivalent on linux somsahi Linux - Hardware 3 09-09-2006 03:11 PM
FL Studio equivalent in Linux? halflife28 Linux - General 1 02-28-2006 05:45 PM
Exchange Equivalent in Linux badogg Linux - Networking 1 10-11-2004 05:55 PM
The Linux equivalent of NT domains? jkrische Linux - Networking 11 04-14-2004 03:41 PM
What is the Linux equivalent of ADaware? studpenguin Linux - Newbie 4 03-28-2004 03:27 PM

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

All times are GMT -5. The time now is 09:23 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
Open Source Consulting | Domain Registration