LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-22-2009, 09:25 PM   #1
holmes86
LQ Newbie
 
Registered: Jan 2009
Posts: 9

Rep: Reputation: 0
Meger partition file


hi,everybody

I have a question,maybe laughable.I want to know that whether resolve way or not.

I have two partitons,for example are /dev/sdb1 and /dev/sdb2.Meanwhile there is dir/filename1 in /dev/sdb1 and dir/filename2 in /dev/sdb2.I want to meger the partition file,just like:
mount /dev/sdb1 /mnt
mount /dev/sdb2 /mnt
find /mnt can see file of each partition
/mnt
/mnt/dir/filename1
/mnt/dir/filename2

thanks.
 
Old 09-23-2009, 01:57 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I'm a little fuzzy on what you are trying to do, but here are a few basics:

1. Mounting is really like connecting. If you have data on a device, you access it by connecting it to your filesystem. To be precise, you mount (connect) a filesystem---i.e. you cannot mount a partition that is not formatted with a filesystem

2. You can mount different devices (filesystems) to the same mount point, but you can only see the last one mounted.

3. the normal way to combine partitions so that they behave as one is to use LVM, but I don't think you can do that after each alread has a filesystem + data.

4. The best way to get a feel for what works is to run your own experiments.

Last edited by pixellany; 09-23-2009 at 01:59 PM.
 
Old 09-23-2009, 04:44 PM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by pixellany View Post

2. You can mount different devices (filesystems) to the same mount point, but you can only see the last one mounted.
Normally, you can only see the last one mounted, but there are ways of using aufs or unionfs to overcome that restriction....its just that I don't know enough about them to do more than point you at the man pages.

However, I suspect that if I really understood your question, there would be a better way of solving it. Did
Quote:
meger
mean merge? And did you really need to merge the filesystems or do you need lists of files on the two filesystems and to merge those two lists? And what to do about duplicates? And what about files which have the same name (leaf) but aren't in the same directory?
 
Old 09-24-2009, 01:12 AM   #4
holmes86
LQ Newbie
 
Registered: Jan 2009
Posts: 9

Original Poster
Rep: Reputation: 0
thanks for your help.
salais,This is a bad question.I know this is a ridiculous idea,and must be not doing.becase the customer don't express clearly your problem at first.I'm so sorry.
thanks everyone again.
 
Old 09-24-2009, 04:21 AM   #5
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
I wouldn't say that it is a ridiculous question, even if it is still an unclear one and I don't see the possibility of you getting a good answer until it becomes a clear one.

You have two directories each of which has files in it (and possibly many sub-directories...that isn't clear). That these are on different partitions may not be relevant.

I am not clear what the outcome should be: is a list of files what you want, is it that 'find' should behave as if there is a single merged partition, is it to create a new directory structure (maybe on a different partition, maybe not) which has a merged set of files, is it to irreversibly merge the two sets of files in one of the existing directory structures, is it to temporarily make it look as if there is a merged directory structure?

And, you haven't answered the question about duplicate filenames? can you guarantee that there are no duplicate filenames, and, if not, what do you intend to do about that?

You said originally that you had a question. I am still unclear what it is.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File recovery after partition table damage - XFS file system gracecourt Linux - General 4 09-28-2017 05:29 PM
Hard Drive Partition Management - Mandriva Double Partition with Swap File partition moshebagelfresser Linux - Hardware 2 05-23-2008 10:46 AM
Copy Contents of LVM Partition to Another Partition With a Different File System tmort Linux - General 3 03-07-2008 05:00 AM
What is the code to copy a file from my windows partition to my linux partition? THEBIGFISH Linux - Newbie 3 03-15-2004 10:14 PM
To meger or avail all the existing partition saravanan1979 Linux - Hardware 1 05-31-2002 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:09 AM.

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