LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 06-09-2007, 11:19 PM   #1
len
Member
 
Registered: Jun 2003
Distribution: slackware 12
Posts: 140

Rep: Reputation: 15
will 2 /home partitions mirror data?


wondering if errors will be produced if a fresh install using 2 identical hdd's for 2 /home mount points?
 
Old 06-10-2007, 12:44 AM   #2
stzein
Member
 
Registered: Mar 2004
Location: Antwerp, Belgium
Distribution: Gentoo
Posts: 65

Rep: Reputation: 15
I think mounting something in a place where another device was mounted already will kick the first device off. So you won' have two devices mounted in the same place at the same time.
Are you trying to get some kind of RAID funcionality without a RAID controller? I think you best just set up some kind of automated mirroring in that case. rsync in a cron job for example.
 
Old 06-10-2007, 12:47 AM   #3
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 60
Just to make sure I understand your question, you wish to mount two different partitions on /home? If you do so, the second partition will just "cover up" the first one such that the first partition may as well not be mounted at all. But it won't give errors.

If you wish to mirror a partition, I suggest you run rsync as a cron job maybe something like every 15 minutes:

Code:
[root@box /root]#mkdir /home_mirror
[root@box /root]#mount /dev/sdb1 /home_mirror
With the following entry in /etc/crontab

Code:
*/15 *	* * *	root	rsync -a --delete /home/ /home_mirror
Adjust the partition and time interval to your needs and tastes, and modify /etc/fstab so that the mirroring partition gets mounted each time. Also, check rsync's man page for the meaning of options and make sure this is what you want.
 
Old 06-10-2007, 06:57 AM   #4
kickzha
LQ Newbie
 
Registered: Sep 2004
Location: augsburg homeboy
Distribution: debian sarge/sid
Posts: 17

Rep: Reputation: 0
...it seems to me that u expect the behaviour of the so called 'union'-Filesystem.

That is, u mount a Partition (that with the union-fs driver between kernel and partition's Filesystem - check union-fs documentation how to do so), and mount one ore many more partitions (not needing equal size) about the first, second,...

With the unionfs-utils u can make some partitions writeable, some just readable. What u get is maybe that (suppose 0/1 is atom file):

(example)

1 0 1 0 1 first part readonly
0 1 0 1 second part writeable (u see this partition is REALLY different )
1 1 1 1 1 u get if accessed by sytem (all files of all partitions). Modifying these ones (file 1 & 3)
1 0 1 u will have
1 1 1 1 on the second
1 0 1 0 1 on the first partition (file 1 & 3 still being the old version), killing three files
1-1-1- u get for the system having
0 0 0 1 1 which means
0 0 0 1 on the second one and
1 0 1 0 1 on the first partition

...changes only happened to the writeable partitions.

But u can have all writeable, and the changes will happen to all.

you can add a third, making the first & second readonly applying changes to the third. Make all writeable and changes will happen to all, but only CHANGES - that means, you mount two writeable they will not be synced.

How that behaviour applies to an error on one of the partitions (as your disk crashed)? - that is out of information to me.
 
Old 06-10-2007, 08:15 AM   #5
len
Member
 
Registered: Jun 2003
Distribution: slackware 12
Posts: 140

Original Poster
Rep: Reputation: 15
great replies-thanks!


i was intending to have a /home mount point mirrored using software raid1 during setup. i didn't find the right documentation during the install, so i set up one hd as /home, and then wondered what would happen if i added another as home? when i booted up, kdisk free showed equal usage for each hard drive labeled /home! i'm getting some corruption on a third hdd set up for all the other mount points, that showed fsck activity at initial bootup (reboot), and errors, which i believe is the hdd (it's sqwealed previously during large data transfers- [ahh, my cache is full]- what it is?).


i saw a refernce to not raiding swap space, and just setting up multiple swap partitions, and the kernel would span/ mirror them. so i got the idea that it might work.
 
Old 06-10-2007, 08:23 AM   #6
len
Member
 
Registered: Jun 2003
Distribution: slackware 12
Posts: 140

Original Poster
Rep: Reputation: 15
just for clarity, i have a 30gig hdd for mount points /, /usr, /var, /tmp swap, and 2 larger identical hard drives for /home.

at present, the 30 gig hdd seems to be going down- CRC errors, and some error codes present during boot up that i'll look up for confirmation.
 
Old 06-10-2007, 02:24 PM   #7
len
Member
 
Registered: Jun 2003
Distribution: slackware 12
Posts: 140

Original Poster
Rep: Reputation: 15
how to confirm data is mirrored/ identical across 2 drives?

current status looks good. zerofilled, and reformatted the 30gig drive, and 2 identical larger hdd's. partitioned, and did a slow format that checks for bad blocks (status 0x51, and error 0x84 from what i've read pointed to bad blocks) for the 30gig hdd partitions. reinstalled slack 11, and did notice that when the file size would go over a certain megabyte size, it would still put out a kind of squeal sound, though reboot didn't show any errors. the 2 larger drive with /home mount points take the larger data transfer loads, so i might be ok for awhile. tranferred about 12gigs of data to it, and the comp was silent (comforting/ most excellent ).

so, according to kdisk free, the volumes for both /home hard drives showed an identical increase in data held after ftp'g 12+ gig's to "/home". how can i confirm if the drives are mirrored identically, as opposed to non uniform distribution? would checksumming the devices work? would there be a better approach?
 
Old 06-10-2007, 03:59 PM   #8
stzein
Member
 
Registered: Mar 2004
Location: Antwerp, Belgium
Distribution: Gentoo
Posts: 65

Rep: Reputation: 15
checksumming should work. It could take some time though.
You could also remount one of the drives on a different mountpoint (say, /mnt/temp) and then check with ls, df, du, whatever if you get the same output.
something like this:
Code:
ls -halR /home > /tmp/homels1
ls -halR /mnt/temp > /tmp/homels2
diff /tmp/homels1 /tmp/homels2
rm /tmp/homels*
or equivalent for other commands that get some info about your mounts
 
Old 06-10-2007, 11:52 PM   #9
cyberfishee
Member
 
Registered: Mar 2005
Distribution: Debian Testing
Posts: 133

Rep: Reputation: 15
besides the rsync approach, you can also try setting up software RAID, which provides some advantages over rsync (synchronized updates, ~2x reading speed, and fault tolerance)

btw, the rsync approach does not really provide hardware fault-tolerance (if a file on the first harddrive is corrupted due to a hardware failure (bad sectors), the corrupted file will be automatically copied to the second hd, replacing the good file.

I personally like the software RAID approach and has been using it for years
 
Old 06-11-2007, 01:19 AM   #10
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 60
Quote:
Originally Posted by len
i didn't find the right documentation during the install, so i set up one hd as /home, and then wondered what would happen if i added another as home? when i booted up, kdisk free showed equal usage for each hard drive labeled /home!
I think you just discovered an interesting peculiarity of the disk size monitoring tools. In other words, I think kdisk lied to you.

I just tried a similar experiment on Ubuntu 6.10, except I used df instead of kdisk. I mounted two partitions to a single mount point and then copied a bunch of files to that mount point. Using df, both partitions reported the same usage. However when I unmounted the second partition, both df and ls told a different story. None of the files I had copied were on the first partition. Just the lost+found directory.

BTW, you can use multiple swap partitions at one time. But there is no mirroring going on. If the swap partitions all have the same priority, the kernel will distribute the swapped out material among the partitions, roughly equally. Otherwise, they will be used sequentially in order of their priority.
 
Old 06-11-2007, 10:54 PM   #11
len
Member
 
Registered: Jun 2003
Distribution: slackware 12
Posts: 140

Original Poster
Rep: Reputation: 15
i'll experiment with your generous advice guys. currently running md5sum, and i'll check it in the morning. i need to find 3 or 4 hours of free time to go over the system with commands, shut down system, disconnect 1 drive, boot the other, etc.......
 
Old 06-12-2007, 05:28 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: SuSE 11.4_64-KDE, 12.1_64-KDE
Posts: 3,346

Rep: Reputation: Disabled
For your "squealing" 30 GB disk (and the others) you might consider using http://smartmontools.sourceforge.net/
 
Old 06-12-2007, 10:28 PM   #13
len
Member
 
Registered: Jun 2003
Distribution: slackware 12
Posts: 140

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by JZL240I-U
For your "squealing" 30 GB disk (and the others) you might consider using http://smartmontools.sourceforge.net/
enabled smart, and the drive tests ok. i'll reread man page, and see if there are other ways to test the drives. great advice!
 
Old 06-13-2007, 01:26 AM   #14
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: SuSE 11.4_64-KDE, 12.1_64-KDE
Posts: 3,346

Rep: Reputation: Disabled
Here is an other goodie if you are interested in graphical evaluation:

http://www.linuxquestions.org/questi...d.php?t=559184

I'd advise to read the whole thread, these guys really seem to know what they are about. Have fun .

Last edited by JZL240I-U; 06-13-2007 at 01:27 AM.
 
Old 06-13-2007, 08:14 AM   #15
len
Member
 
Registered: Jun 2003
Distribution: slackware 12
Posts: 140

Original Poster
Rep: Reputation: 15
i just ran df command for each /home device and they both report the same statistics- which leads me to believe that the drives are mirrored, and have the same data.

i tried to run md5sum for each /home device, but that returned input/ output errors. i would guess that md5 is for files, as opposed to devices?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping Windows share, then mirror data loadedmind Linux - Networking 5 02-07-2008 03:25 AM
Question on creating more partitions than default ones, i.e. /home,/root partitions casmac Suse/Novell 1 12-20-2006 05:02 PM
install new distro WITHOUT loseing data in /home and other partitions Lleb_KCir Linux - General 5 07-20-2005 09:47 AM
Rsync to mirror data for backup - having difficulties tapanga Linux - Newbie 1 05-17-2004 05:45 PM
data mirror between machines knobby *BSD 1 07-25-2002 10:58 PM


All times are GMT -5. The time now is 06:18 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration