Linux - GeneralThis 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
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.
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.
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...
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
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:
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.
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:
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.