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.
I wonder would /home on /(dedv/sda3) be the same as /home on its own partition(/dev/sda2)? If YES, then I will exclude /home on backup /. Otherwise it would be a duplicate, taking up space.
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222
Rep:
lol, sorry about that.
yes I meant /dev/sda2 is mounted on /dev/sda3 (in the home directory)
additional partitions are usually mounted on the root partition to allow access to their filesystem. I hope that clarifies things.
Quote:
To my understanding if / partition corrupted accidentally /home partition still there with all Data files. Is it correct?
Yes. The data stored in /dev/sda2 will be safe even if /dev/sda3 crashes. That is why your current configuration is ok. Your /home is on a separate partition.
Quote:
Furthermore can I move /home of / (dev/sda3) to /dev/sda2 instead of mount this partition?
/dev/sda2 is your /home partition. Do you mean you want to move the contents of /dev/sda2 to the /home directory of /dev/sda3? If this is your question then the answer is yes. You will just need to remove the entry for /dev/sda2 in /etc/fstab. unmount /dev/sda2 then mount /dev/sda2 on /mnt and then do a 'cp -rf /mnt /home'
Last edited by SlackDaemon; 06-28-2006 at 07:23 AM.
Let me try to explain what "mounting" really is for starters:
1. The data (files/directories) is stored on a physical hard drive, which you know and use via the special device files, called "sda2" and "sda3".
2. All the data from sda3 is mounted as your root partition. This means that the top level directory on sda3 will be shown to you as the "/" directory. Files and subdirectories on sda3 will thus also be shown as files/subdirectories under "/" as well, for instance /etc.
But how can you know use the data on your sda2 physical disk? You can't make the top level directory on sda2 appear as the "/" directory, because you already have said to your system that "/" is the top level dir of sda3 (you can only have one "/" dir).
So, to make the contents of sda2 visible in your global file hierarchy (directory structure), you will need to say to your system "put all the contents of disk sda2 and show it as directory x".
And this is exactly what mounting does. It takes the contents (files/dirs) of your sda2 drive and puts all that under /home, which is an empty directory on your sda3 disk. Think of it as "overlapping" sda2's contents on top of the /home (empty) on sda3.
However, mounting is done in a transparant way. So, when you are using your filesystem, ie accessing a file in /etc, /home, etc, the system will automatically figure out on which disk the file is really stored (ie /etc => sda3, /home/... => sda2) and it will locate the file for you.
So, the data is not "duplicated" in any way. It's simply distributed among multiple hard disks (partitions),
which are shown transparently as one big directory structure (going down from /).
To answer your backup question: it cannot "duplicate" the sda2 data, so don't worry.
If you tell tar to backup everything from / and down, it'll include the entire contents of /home (stored on sda2 if it is mounted) just once.
Note that, if you unmount sda2 via the "umount" command(not recommended, I'm just making a point), your /home will most be empty again, as it no longer represents the contents of sda2...
"sda2" is called the mounted partition, /home is called the "mount point" (the directory in your directory structure where the partition is mounted/shown).
See also
Code:
man mount
man umount
and the /etc/mtab file (list of current mounts).
And yes, if your / partition becomes corrupted, your /home (sda2's contents) can still be there intact.
The logical structure of Linux is that there is always a single "file system" that is anchored at the so-called root ("/"). So no matter where it is physically, that's where it always is logically.
Try the mount command with no parameters, to see where stuff is.
Sorry I don't follow. Whether /home on its own partition is symlinked to /home on /? OR it is a duplication?
satimis
Sorry should have explained it better, Timmeke has explained it muuch better. But basically it is like symlinking it to another partition, it is all done transparently to the user. And as others have said, if you damage or wipe the / root partition all the data will be safe on the /home partition. And if you do a backup you want be duplicating data on the /home drive.
When I first starting using linux I had similiar questions because the concept of a root filesystem being mounted on multiply partitions didn't seem possible. But once you get your head around it, you see the benifits of such an ability.
Try the mount command with no parameters, to see where stuff is.
# mount
Code:
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
automount(pid1727) on /net type autofs (rw,fd=4,pgrp=1727,minproto=2,maxproto=4)
/dev/sda2 on /home type ext3 (rw)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.