Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 22 Dec 2014, 06:00
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
HowTo use chroot for setting current shell`s "/" ?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 2 of 3 Posts_count   Goto page: Previous 1, 2, 3 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Wed 20 Jun 2012, 04:15    Post_subject:  

### FORGET ALL THIS... It`s much too complex and isn`t a solution.


### I finally found what I`ve been looking for.

I wanted a link that points to many targets.
I found a mount that combines many targets ( the reverse ).
It`s like a union without the complexity and problems.
Tests showed it had no cpu load ( it`s just a mount ) and no ram use.!
It can be used to combine partitions into one, and dirs. too.
# And... It got 5 a star rating.!

It`s called "mhddfs", it uses Fuse and is simple to use.
It merged 2 dirs. with files and another with a link as it`s path.
# NOTE: Be sure to use the / at the end of the mount point or it adds /root ( don`t know why...).
Code:
@@@@ To mount:
sh-4.1# mhddfs /tmp/0,/tmp/1,/root/docs/0 /tmp/7/ -o allow_other

mhddfs: directory '/tmp/0' added to list
mhddfs: directory '/tmp/1' added to list
mhddfs: directory '/root/docs/0' added to list
mhddfs: mount to: /tmp/7/
mhddfs: move size limit 4294967296 bytes

@@@@ To unmount:
sh-4.1# fusermount -u /tmp/7

@@@@ This allows all users access. Not just mount creator:
 -o allow_other


There are a few other utilities like it, most are for merging HD partitions.

This will make the difference in easy to make and use app. packages.
And also for rearranging the Linux file system for a new type of O.S.
mhddfs_0.1.28-1_i386.zip
Description  From Ubuntu Lucid, so good for most Puppies I think.
Puppy Lucid528 has everything else that`s needed ( Fuse ).
zip

 Download 
Filename  mhddfs_0.1.28-1_i386.zip 
Filesize  24.13 KB 
Downloaded  230 Time(s) 

Edited_times_total
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Wed 20 Jun 2012, 04:25    Post_subject:  

I was looking at that the other day, but I couldn't quite figure out the advantage over unionfs...
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Wed 20 Jun 2012, 04:44    Post_subject:  

Simpler is the main thing I see... So fewer problems ( white-out files ).

It seems better suited to combining small parts of the dir. tree than a union.

And with virtually no system usage, you can use it many many times!
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Wed 20 Jun 2012, 21:46    Post_subject:  

How does it enable "deleting" if it doesn't use white out files?
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3982
Location: Kiel,Germany

PostPosted: Wed 20 Jun 2012, 22:00    Post_subject:  

sunburnt wrote:
Simpler is the main thing I see... So fewer problems ( white-out files ).

It seems better suited to combining small parts of the dir. tree than a union.

And with virtually no system usage, you can use it many many times!


FWIW : I had my first Puppy crash since i upgraded to more recent hardware ( MWDMA 4GB HDD to DMA-100/133 HDD ) with racy-5.2.2 which uses unionfs : X showed console with X-cursor and panic was something with unionfs (flash pendrive PUPMODE=13) .

Racy-5.3 again uses aufs .

Quote:
I used Unionfs in the kernels in Wary and Racy 5.2.2, and I thought that all was well.

Unionfs letting us down?
Back to top
View user's profile Send_private_message Visit_website 
jamesbond

Joined: 26 Feb 2007
Posts: 2232
Location: The Blue Marble

PostPosted: Wed 20 Jun 2012, 23:25    Post_subject:  

Good find, sunburnt!

disciple wrote:
How does it enable "deleting" if it doesn't use white out files?

I haven't tested it, but I'll hazard a guess - all the underlying filesystems must be writable; so deleting a file will actually delete it from the underlying filesystem. Now how it handles files / directories with same name will be interesting ... e.g you have to dirs with the same name in /sdb1/0 and /sda1/0, when you delete /virtual/0 what would happen ... I'll guess again it will delete *both*.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send_private_message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Thu 21 Jun 2012, 01:37    Post_subject:  

sunburnt wrote:


It`s called "mhddfs", it uses Fuse and is simple to use.


Looks like a big performance drain:


"The results are painful, mhddfs introduces a huge overhead."
"FUSE? yuck.. so not even kernel level.. You sure you want to store your files that way?"
"Well, assuming that mhddfs/fuse causes lower performance, your options would be:"

http://hardforum.com/archive/index.php/t-1501421.html
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Thu 21 Jun 2012, 02:32    Post_subject:  

And
Quote:
If there's something that is bloated, slow and sub-optimal its FUSE.

Smile

That's what I suspected about FUSE, but I figured sunburnt must have had something on which to base that "virtually no system usage" claim.

Now this sounds interesting:
Quote:
Personally i would feel much more at home with ZFS; it does create a single volume out of your multiple drives (which is what you want) but doesn't rely on any userland-drivers like FUSE does.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2294

PostPosted: Thu 21 Jun 2012, 04:54    Post_subject:  

For most use cases, the penalty from using FUSE is likely not a problem.

Somehow I had never been aware of mhddfs. It seems to be tailored to the specific use-case: User wants to combine multiple hard-drives into a single 'view', with normal ability to add or delete files.

Aufs can also use multiple write-layers. Unionfs can only use one write-layer. Unionfs and aufs both operate at the kernel-level, so throughput penalties are minimal. unionfs has the advantage of being part of the mainline kernel code, though this may not always be so.

aufs is actually less invasive to kernel code, but is much larger than unionfs code(because it has the most features). Mainline kernel devs want (or could accept) union *mounts*, but not more union file systems. A union mount is only for a single device, one level deep, whereas union file systems can be multi-level.

My src2pkg uses either in-kernel unionfs or (default) the FUSE-based unionfs-fuse program to create limited unions.

For the purpose of having a read-only file system act like a writable FS using a 'save-file' or save drive, aufs is most flexible.
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3982
Location: Kiel,Germany

PostPosted: Thu 21 Jun 2012, 16:41    Post_subject:  

I got curious and compiled the fuse stuff with one or two dependencies for the devel files and it put me a /etc/init.d/fuse file .

Seems that it mounts

fusectl on "/sys/fs/fuse/connections" type fusectl (rw,relatime)

And when i shutdown yesterday it seemed that unmounting

"/sys/fs/fuse/connections"

automatically unmounted ntfs partitions mounted with ntfd-3g .

At least the output of my rc.shutdown.local.start script told me, that in the for loop all of a sudden /dev/sda7 had been invalid ...


It seems bit similar to killing ntfs-3g leaving the partition ("dirty") unmounted .
Back to top
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Thu 21 Jun 2012, 17:13    Post_subject:  

Mhddfs was intended to union partitions, which are just dirs. My use.

disciple; White out files are only needed for non-writable layers I think.
As amigo says, the unionfs only has the top writable layer.
The web site said it used almost no resources, but maybe not fuse...

Karl; Unionfs was all there was for a long time, but aufs is much better.
Unionfs had problems when Barry started using it on / .

jamesbond; I believe the web site said it acts on the first file in the list.
So then it behaves just like a path with a hierarchy. That makes sense.

jpeps; Apparently web site claims and user experience is different.
Write slowdowns were solved by using aufs instead.
I figured with the simpler layout of mhddfs it`d be faster.

amigo; It`s not so much making a r/o fs act r/w as combining dirs.

# As I see it, the dir. /usr/share is the place for most app. deps.
I need to combine the main /share with all the separate app. pkgs.
So when the app. looks for deps. they appear in the correct place.
Using a union to do this would mean many layers, but small dir. trees.
There are probably other dirs. that need this also.

Exec. use PATH, and libs. use LD_LIB_PATH, but normal files have none.
So I hatched the idea of a multi. target link, with low resource usage.
It doesn`t try to combine dir. trees, it just points to multiple targets.

Mhddfs is simpler than aufs, but sadly that doesn`t mean it`s better.
Aufs may very well preform faster with less cpu overhead.
I did not want a full blown union, but for my intended limited use...
Perhaps mhddfs will be kernelized, or someone will make a multi. link.
.

Edited_time_total
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3982
Location: Kiel,Germany

PostPosted: Thu 21 Jun 2012, 17:33    Post_subject:  

sunburnt wrote:
Mhddfs was intended to union partitions, which are just dirs. My use.


This seems apparently how fuse is working. fuse has a lot of meanings using dict fuse, i guess the string
"2. To unite or blend, as if melted together.
[1913 Webster]"

would fit a mount.fuse description best .

So using fuse i would need to mount partitions first "normally" and then

mount.fuse /mnt/sdb1 /mnt/new
mount.fuse /mnt/sdb2 /mnt/new

so these two partitions can be merged
?
Back to top
View user's profile Send_private_message Visit_website 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Thu 21 Jun 2012, 17:53    Post_subject:  

Dear Terry (aka sunburnt),

I think that is a really nice find. I now have to think of how I can use this facility intelligently. Many ideas will come to mind in time. If you have some already, please post.

With thanks and kind regards,
vovchik
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Fri 22 Jun 2012, 00:12    Post_subject:  

Karl; I think your setup would do the usual mount thing of stacking.
Each mount covers the previous one, I think that`s mhddfs purpose.
But it may work the way you`ve proposed, it`d be interesting to see.

vovchik; I`m hoping it can work out for what I need. Aufs is overkill.
I`ve had thoughts about it, and I`ll elaborate more below.

# I think the reason for mhddfs slow writes is due to it`s checking
the mount`s sizes each time. It would be faster at it, if it kept a list.
This would explain the big difference in read / write times reported.
If it just wrote to the first mount until a full error and then the second.

For my purpose, I only need to read from the common /share mount.
So perhaps the cpu load won`t be so bad. I`ll test a little and report.

Sadly my mounts are dirs., so there`s no reason to check their size.
And it`d be really nice if it could remount to add / remove branches.
One can only hope that mhddfs is improved on and features added.

My main thought: Are there any other dirs. app. deps. are kept in?
The Linux dir. tree is large and the rest of it can`t be just for the O.S.
Some of /share is not deps., and /local has very little in it, in Puppy.
/root has config. files and likely other stuff too, but no deps I think.
.

Edited_times_total
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Fri 22 Jun 2012, 01:10    Post_subject:  

Update: I renamed /usr/share to /usr/share_0 and made a dir. /usr/share
I mounted /usr/share_0 and an app`s. /usr/share on it and it works great.
But... It won`t unmount /usr/share, something`s using it. So it`s worthless.
If it could remount, that would probably work even with the mount busy.
And doing this trashed my internet setup, running the wizard fixed it.
Probably what was keeping it from unmounting, it could be fixed maybe.
But trying to repair all of the possible problems becomes a nightmare.

This is why I really want multi. link, mounts are dicey and more complex.
A link is about as small a resource as a FS has. No mount or unmount.
A multi. link would do exactly the same thing without all the problems.
Though it would only write to the first item in it`s list, no distribution.
For my needs this wouldn`t matter as I only need to read /usr/share .
Using: ln -sT the -T option writes a link over an old one while in use.
So this allows rearranging multi. link`s branches on the fly.

I`ll look at using aufs, even though it`s massive overkill for my needs.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 3 Posts_count   Goto page: Previous 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0973s ][ Queries: 13 (0.0086s) ][ GZIP on ]