Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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 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
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.