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 Fri 21 Nov 2014, 00:41
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Scratch File Tool
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [20 Posts]   Goto page: 1, 2 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Fri 04 Jun 2010, 17:07    Post subject:  Scratch File Tool
Subject description: create ext2 filesystems in xxx.img files
 

Scratch File Tool

Create, mount and unmount a scratch file - an ext2 linux filesystem inside a file

This is provided as is, although I will happily add any fixes or improvements suggested to me.
I don't think I know enough to make this any better, but will do so with help.

The mount point is leftover after unmounting, but other than that, this seems to work fine.

All scratch files are mounted to /mnt/scratch_mnt_point

A lot of credit should go to the contributions here

There is also a tip on the thread above which tells you how to mount the scratch file at startup, giving you more space automatically, when you boot Smile
scratch.png
 Description   
 Filesize   43.42 KB
 Viewed   2361 Time(s)

scratch.png

scratch-file-tool.pet
Description 
pet

 Download 
Filename  scratch-file-tool.pet 
Filesize  2.69 KB 
Downloaded  809 Time(s) 

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Mon 30 Aug 2010, 09:18; edited 3 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Sun 06 Jun 2010, 17:26    Post subject:  

Any feedback on this?

I'd like to make it work 100%, but can't do it by myself Sad

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Sun 06 Jun 2010, 17:46    Post subject:  

What file systems does it support?
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Sun 06 Jun 2010, 18:33    Post subject:  

ext2, its in the screenshot Smile
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Sun 06 Jun 2010, 18:49    Post subject:  

Thanks.
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Thu 08 Jul 2010, 16:25    Post subject:  

Anyone used this? Any suggestions? I may have another go at making this again, and would be happy to include any requests, if anyone is interested..
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Fri 09 Jul 2010, 14:35    Post subject:  

Haven't used it yet. As for features to add, all I can think of is more filesystem choices.
_________________
adobe flash is rubbish!
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Sun 11 Jul 2010, 05:05    Post subject:  

abushcrafter wrote:
Haven't used it yet. As for features to add, all I can think of is more filesystem choices.

That's all I can think of, too.. Aside from cleaning up the code a bit.. Embarassed

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6690
Location: lisbon

PostPosted: Sun 11 Jul 2010, 23:34    Post subject:  

Was it from this thread?
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Mon 12 Jul 2010, 06:38    Post subject:  

muggins wrote:
Was it from this thread?

Yes it was! I couldn't find the thread again, to post a thanks/credits..
So yes, all credit for this goes to the guy who done the thing on that thread! Very Happy

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
emil

Joined: 10 Nov 2009
Posts: 618
Location: Austria

PostPosted: Fri 03 Dec 2010, 05:14    Post subject: Any response on scratch files?  

Hello sc0ttman,

did you have any response on this? I resently built a puppy derivate "sagelive" which contains the mathematic software sage (rather big). I also used noryb009's method to create a Windows Installer exe, so it is possible to install it frugaly into an Windows Filesystem from inside windows with one click.

I thought this is a cool method and major imporvement, especially because sage does not compile on windows, and even there is no Cygwin port available. This is a pitty because this cuts the potential userbase of the project enourmosly (especially in education).

However my approach was taken very sceptical from the sage community. There were fears to break something in the boot process, and also serious concern to protect the integrity of the NTFS filesystem. It is also understandable, because they want to do math and not primarily play around with bootloaders, partitions or fix broken systems of students.

Maybe I could counter this fears with the possibility to create a reasonable sized linux file on the NTFS partition which could be mounted at startup by default. It would be possible then to create all necessary files and diskspace once (safe file and scratch file), so later use would be independent of any NTFS - write operations.

However you mention that the scratch file is small in the beginning and grows later with use. Does this mean there is access to the NTFS system during its use to resize it?

Kind regards
emil
Back to top
View user's profile Send private message Visit poster's website 
aarf

Joined: 30 Aug 2007
Posts: 3620
Location: around the bend

PostPosted: Fri 03 Dec 2010, 05:55    Post subject:  

Emil: Post a link to the sage discussion and we'll send over some heavys and give'em a whoopin'
_________________

ASUS EeePC Flare series 1025C 4x Intel Atom N2800 @ 1.86GHz RAM 2063MB 800x600p ATA 320G
_-¤-_

<º))))><.¸¸.•´¯`•.#.•´¯`•.¸¸. ><((((º>
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Fri 03 Dec 2010, 06:27    Post subject: Re: Any response on scratch files?  

Hi emil...

In answer to your question, actually, although I was told the scratch file would grow in size, I am pretty sure it doesnt - if you create a 100mb scratch file, it will be 100mb right away... and doesnt get bigger.

You can auto mount the scratch file with a script in /root/Startup.. IT could also be put in rc.local, or .xinitrc (I guess)...

The command to mount the scratch file is:

mount -t ext2 -o loop /mnt/home/ext2_scratch.img /mnt/ext2_scratch/

(or similar)

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2276

PostPosted: Fri 03 Dec 2010, 16:58    Post subject:  

Here's a couple of links that show one way of creating empty files under windows:
http://www.webtlk.com/2010/10/31/how-to-create-empty-files-in-windows-operating-systems/

http://www.softwaretipspalace.com/how-to_features/software/how_to_create_empty_file_with_specific_size.html

I used to maintain a distro called amigoXP which was designed to be installed from a running windows 98 or XP system. I used a program called bigfile.exe to create an empty file on the windows partition. The installer (a .bat file) would then create an entry in the boot.ini file which would let you boot the amigoXP system. Booting amigoXP would format the empty file with a linux filesystem, loop-mount it and then populate it with the main part of the distro. It was quite similar to what you will recognize as a frugal installation -excpet that everything was on the hard drive. The kernel and initrd were located in the root of the C: drive. The initrd contained some parts of the system, the rest were inside the loop-mounted partition image (what was the empty file).

The above two links show how to create the empty file using standard windows tools which can be scripted with a *.bat file or accessed using other methods (noryb009's method).

As for files that 'grow' as needed, it is possible to create a 'sparse' file which is large or small depending on which program you examine it with. See here:
http://murga-linux.com/puppy/viewtopic.php?search_id=256251839&t=54800

and here:
http://www.murga-linux.com/puppy/viewtopic.php?p=327020&sid=d7d5b534002a7635f4b2695ec6e195fa

As mentioned in those posts, results will vary on windows. The thing is that these 'sparse' files are not really sparse -they only seem to be smaller than they really are because they are filled with zeros. Using the du '--apparent-size' option shows you the real size of them.

Oops, I just noticed that one of those threads is what is linked to above -still, the 'sparse' is completely separate and is only done with the 'skip' option to dd. Filling the file with zeros(without the skip option) will just show the file as having it's real size.

If you have no qualms about using ntfs-3g to access and write to ntfs drives, then you could always create and/or resize the files at will from linux -if the filesystem supports resizing -like ext2/3. The advantage of using ext2 is that less space is consumed by the filesystem formatting itself. Using ext3/4, reiserfs or other journalling filesystem will consume lots of space even before anything is written to the filesystem.

I run a system with a patched kernel which includes support for compressed ext2 filesystem, so that any files you copy to such a partition (or loop-mounted partition image) are automatically compressed whe they are copied. When reading the files they are transparently de-compressed. Using this feature displays similar properties as the sparse file -using du with and without the --apparent-size option gives you two different figures. But, in this case, you are able to put twice as many files in the same space. In other words, you can put 100MB of files into a 50MB partition or partition image without any extra tricks. By using upx and then ext2-comp, you xan put what would normally be 100MB of files into 25MB! kewl... but hard to maintain since it means maintaining a rather large and invasive kernel patch.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Sat 04 Dec 2010, 06:52    Post subject:  

amigo, the second link you gave is the one on which this tool is based.. listed earlier... I have not found the file that is created by this code to be a 'sparse' file..

I'm sure it's meant to, but that's just not my experience...

When i choose 100mb, its 100mb straight away... The file created by the code in the 2nd link you provided has always worked for me like an additional save file or something (stays the same size) ...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [20 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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