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 06-27-2006, 11:25 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
About backup question.


Hi folks,

FC5_64

/home on /dev/sda2
/ on /dev/sda3

On installation I created a partition for /home. But now I found another /home on /

# ls -l /
Code:
total 158
drwxr-xr-x   2 root root  4096 Jun 24 10:37 bin
drwxr-xr-x   4 root root  1024 Jun 25 21:24 boot
drwxr-xr-x  12 root root  4060 Jun 28 07:32 dev
drwxr-xr-x  96 root root 12288 Jun 28 08:38 etc
drwxr-xr-x   4 root root  4096 May  5 11:54 home
drwxr-xr-x   9 root root  4096 Jun 23 22:45 lib
drwxr-xr-x   5 root root  4096 Jun 24 10:32 lib64
drwx------   2 root root 16384 Apr 20 22:53 lost+found
drwxr-xr-x   2 root root  4096 Jun 27 23:45 media
drwxr-xr-x   2 root root  4096 Jun 23 13:42 misc
drwxr-xr-x   3 root root  4096 Apr 28 00:10 mnt
drwxr-xr-x   2 root root     0 Jun 28 07:31 net
drwxr-xr-x   2 root root  4096 Feb 11 17:16 opt
dr-xr-xr-x 129 root root     0 Jun 28  2006 proc
drwxr-x---  22 root root  4096 Jun 28 12:17 root
drwxr-xr-x   2 root root 12288 Jun 27 08:16 sbin
drwxr-xr-x   4 root root     0 Jun 28  2006 selinux
drwxr-xr-x   2 root root  4096 Feb 11 17:16 srv
drwxr-xr-x  11 root root     0 Jun 28  2006 sys
drwxrwxrwt  35 root root  4096 Jun 28 10:39 tmp
drwxr-xr-x  16 root root  4096 May 12 18:36 usr
drwxr-xr-x  23 root root  4096 Apr 20 15:13 var
I don't understand its reason, 2 /homes.


On backup / with bzip2 can I exclude /home. e.g.
# tar jcpf backup.tar.bzip2 / --exclude=/home --exclude=/proc --exclude=/sys etc.

because of insufficient space on / partition and to reduce backup time as well.

After restore I'll add them respectively

# mkdir /home
# mkdir /proc
etc.

Please advise. TIA

Remark: I'll backup /home separately.


B.R.
satimis

Last edited by satimis; 06-27-2006 at 11:30 PM.
 
Old 06-28-2006, 12:59 AM   #2
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
If you mounted /home on another partition, it will still come under / root filesystem. Type at the command line:

df

And post the results
 
Old 06-28-2006, 06:19 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi fotoguy,

Quote:
If you mounted /home on another partition, it will still come under / root filesystem.
Sorry I don't follow. Whether /home on its own partition is symlinked to /home on /? OR it is a duplication?

Quote:
Type at the command line:

df

And post the results
# df
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3              9912592   5268716   4132208  57% /
/dev/sda1               101086     13795     82072  15% /boot
tmpfs                   479636         0    479636   0% /dev/shm
/dev/sda2             13390948   5861048   6838704  47% /home
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.

TIA

B.R.
satimis
 
Old 06-28-2006, 06:35 AM   #4
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Hi,

/dev/sda3 is just mounted on your /dev/sda3 home directory. This is not a duplication.

Best of luck!
 
Old 06-28-2006, 06:54 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi SlackDaemon,

Tks for your advice.

Quote:
/dev/sda3 is just mounted on your /dev/sda3 home directory. This is not a duplication.
Sorry I don't follow. Whether you meant "/dev/sda2 /home partition"?

To my understanding if / partition corrupted accidentally /home partition still there with all Data files. Is it correct?

TIA

Furthermore can I move /home of / (dev/sda3) to /dev/sda2 instead of mount this partition?

B.R.
satimis

Last edited by satimis; 06-28-2006 at 07:00 AM.
 
Old 06-28-2006, 07:02 AM   #6
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
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.
 
Old 06-28-2006, 07:13 AM   #7
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
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.

Last edited by timmeke; 06-28-2006 at 07:14 AM.
 
Old 06-28-2006, 11:40 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
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.
 
Old 06-28-2006, 06:59 PM   #9
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Quote:
Originally Posted by satimis
Hi fotoguy,

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.

Last edited by fotoguy; 06-28-2006 at 07:00 PM.
 
Old 06-29-2006, 05:05 AM   #10
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi sundialsvcs

Quote:
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)
What is "sunrpc"?

satimis
 
Old 06-29-2006, 05:12 AM   #11
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
"sunrpc" seems to be related to the Network File System (NFS) setup.
Check out
http://www.brennan.id.au/19-Network_File_System.html
for instance.
 
Old 06-29-2006, 05:46 AM   #12
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi folks,

Tks for your detail advice.

I'm prepared;
- move /home to a new ext partition leaving a spare logical partition
- install Ubuntu-6.0.6_64 on the spare logical partition.


Steps to be performed as follows;

1)
Create ext partitions;
/dev/sda6 10G ext3 (for moving /home)
/dev/sda7 5G ext3 (for Ubuntu /home)
/dev/sda8 10G ext3 (as common Data storage)

# fdisk -l /dev/sda
Code:
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1734    13823932+  83  Linux
/dev/sda3            1735        3008    10233405   83  Linux
/dev/sda4            3009        9729    53986432+   5  Extended
/dev/sda5            3009        3262     2040223+  82  Linux swap / Solaris
# df -h
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             9.5G  5.1G  4.0G  57% /
/dev/sda1              99M   14M   81M  15% /boot
tmpfs                 500M     0  500M   0% /dev/shm
/dev/sda2              13G  2.3G  9.9G  19% /home

2)
Move /home to /dev/sda6

3)
Run fdisk;
Delete /dev/sda2 (/home) and recreate a logical partition /dev/sda2 5G ext3 for Ubuntu /

4)
Install Ubuntu 6.0.6_64


FC shall be as defaut at boot. Swap and /boot will be shared. I'll backup / and /home separately as compressed tarball, root.tar.bz2 and home.tar.bz2


I have been informed that the Advanced mode of Ubuntu install CD can do the job. However I expect trying the above manually.

Comments and advice would be appreciated.


B.R.
satim
 
Old 06-29-2006, 05:47 AM   #13
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi timmeke,

Quote:
"sunrpc" seems to be related to the Network File System (NFS) setup....
Noted with tks

satimis
 
  


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
backup question d1l2w3 Mandriva 8 01-08-2006 08:56 PM
Backup question gchandler Red Hat 1 05-24-2004 02:55 PM
Backup Question tuxedo-notebook Linux - General 5 04-16-2004 11:26 AM
Backup question Swift&Smart Linux - Software 2 06-18-2003 03:59 PM
Backup question chuck77 Linux - General 1 03-21-2002 02:45 AM

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

All times are GMT -5. The time now is 09:31 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