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 Sun 21 Sep 2014, 08:22
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to install to Compact Flash directly like Hard Disk
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
ant_llias
Guest


PostPosted: Mon 08 Aug 2005, 21:58    Post subject:  How to install to Compact Flash directly like Hard Disk  

I want to install my 512 Mb CF device like hard disk but I want to run / in read only, /var and /tmp in tmpfs, where can I change it, I try in fstab and mtab but it didn't work[/b]
Back to top
bwongchaowart

Joined: 08 Aug 2005
Posts: 8
Location: Pennsylvania

PostPosted: Tue 09 Aug 2005, 12:56    Post subject:  

The easiest way to install to a flash card is to simply put the files vmlinuz, image.gz, and usr_cram.fs on it without extracting their contents. This minimizes writes to the flash device. In that case / is not supposed to be read-only. It is normally tmpfs, so /var/ and /tmp/ are also in tmpfs. Please see /sbin/init_ORIG for details. If you need to customize Puppy you can make new image files.
Back to top
View user's profile Send private message 
ant_llias
Guest


PostPosted: Tue 09 Aug 2005, 14:28    Post subject: How to install to Compact Flash directly like Hard Disk  

Yes, I did at first time, I install my CF card like usb flash system, but the time to boot is like 30 seconds,( I drop 25 seconds from usb wait from the configuration). When I install my CF card like Hard disk the boot is fast < 15 second. I need to compile a kernel to install Real time system, install several programs, and I need fast boot in my project. I need to install / in read only,/var and /tmp in TMPFS. Can you help me?
thanks
Back to top
bwongchaowart

Joined: 08 Aug 2005
Posts: 8
Location: Pennsylvania

PostPosted: Tue 09 Aug 2005, 16:20    Post subject:  

Sorry about not answering you more directly at first. I'm not an expert, but the following might help. Please try at your own risk.

If you look in /etc/rc.d/rc.sysinit, near the top / is remounted read-write:

echo -n "Remounting root rw: ";mount -o remount,rw /;check_status $?

Try deleting this or remounting ro.

You need to copy the contents of /var and /tmp somewhere. Then you mount tmpfs like this:

mount -t tmpfs tmpfs /var
mount -t tmpfs tmpfs /tmp

Move everything back into /var and /tmp.

I have no experience with full hard drive installations, but make sure that you're editing the rc.sysinit that will be present at boot-up, not a fake one as on the live cd (at the bottom of the cd's rc.sysinit /etc gets deleted and replaced).
Back to top
View user's profile Send private message 
ant_llias
Guest


PostPosted: Tue 09 Aug 2005, 18:18    Post subject: How to install to Compact Flash directly like Hard Disk  

Yes, it works but I got rootfs / rw, how to make rootfs ro.
thanks
Back to top
bwongchaowart

Joined: 08 Aug 2005
Posts: 8
Location: Pennsylvania

PostPosted: Wed 10 Aug 2005, 10:48    Post subject:  

Is it necessary to worry about rootfs? If the real filesystem is mounted read-only on /, then nothing can be written to it. You get a message that says "Read-only file system." What else do you need?
Back to top
View user's profile Send private message 
ant_llias
Guest


PostPosted: Wed 10 Aug 2005, 13:32    Post subject: How to install to Compact Flash directly like Hard Disk  

Yes, the / is read only, I just tell it because is strange rootfs is rw. But I understand that is readonly. I think that's all I need.
thank you very much about your help
Back to top
bwongchaowart

Joined: 08 Aug 2005
Posts: 8
Location: Pennsylvania

PostPosted: Wed 10 Aug 2005, 16:38    Post subject:  

I didn't say that rootfs is readonly. You need to study the kernel source for this (I haven't), but the information I have is that rootfs is used internally by the kernel during system bootup in mounting the real root filesystem, which is mounted on top of /, hiding rootfs. So rootfs is never used by the user. See, for example, Understanding the Linux Kernel, 2nd Edition by Daniel P. Bovet and Marco Cesati (O'Reilly, 2002) or maybe the kernel mailing lists. According to Understanding the Linux Kernel:

Quote:
Mounting the root filesystem is a two-stage procedure, shown in the following list.

1. The kernel mounts the special rootfs filesystem, which just provides an empty directory that serves as initial mount point.
2. The kernel mounts the real root filesystem over the empty directory.

[from section 12.4.1, "Mounting the Root Filesystem"]


"File handling in the Linux kernel: VFS layer" by Kevin Boone (http://www.kevinboone.com/linux_kernel_file_1.html) seems to say the same thing.
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11068
Location: Arizona USA

PostPosted: Wed 10 Aug 2005, 19:23    Post subject:  

Hey, does that book define 'mounting' in any detailed but reasonably understandable way?
Back to top
View user's profile Send private message 
bwongchaowart

Joined: 08 Aug 2005
Posts: 8
Location: Pennsylvania

PostPosted: Wed 10 Aug 2005, 20:21    Post subject:  

The step-by-step description of how the root filesystem alone is mounted is about 1150 words. That seems reasonably detailed. "Mounting a Generic Filesystem" is a whole section of its own. For mounting to be understandable you need the technical details -- it's a sort of polished pseudocode with long lists of what functions get invoked and why, what gets passed to them, what happens inside them (they invoke more functions of course), what they return.
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11068
Location: Arizona USA

PostPosted: Wed 10 Aug 2005, 22:04    Post subject:  

Rats. There's no attempt to begin the technical description of 'mounting' with a plain english explanation of what mounting is, why it's necessary? There's been a lot of questions and discussion in the forum about it. The consensus seems to be that it's just something you have to do, like paying taxes. Sad
Back to top
View user's profile Send private message 
Ian
Official Dog Handler


Joined: 04 May 2005
Posts: 1237
Location: Queensland

PostPosted: Fri 12 Aug 2005, 18:01    Post subject:  

To put it in simple terms, mounting is a means of attaching a file to a directory in Linux so that any data in that file can be read or manipulated.

It is much like going to a library taking a book from a shelf and opening it up.

The permissions determine what you can do with the file, read, write or if it is an executable file, execute (or run a program).
Back to top
View user's profile Send private message 
bwongchaowart

Joined: 08 Aug 2005
Posts: 8
Location: Pennsylvania

PostPosted: Sat 13 Aug 2005, 01:04    Post subject:  

I think I might understand now why rootfs is not read-only. This is from the 2.4.31 kernel:

start_kernel() in init/main.c invokes
vfs_caches_init() in fs/dcache.c, which invokes
mnt_init() in fs/namespace.c, which has:

Code:
init_rootfs();
init_mount_tree();

In fs/ramfs/inode.c:

Code:
static DECLARE_FSTYPE(rootfs_fs_type, "rootfs", ramfs_read_super, FS_NOMOUNT|FS_LITTER);

   [...]

int __init init_rootfs(void)
{
   return register_filesystem(&rootfs_fs_type);
}


init_mount_tree() in fs/namespace.c mounts rootfs:

Code:
mnt = do_kern_mount("rootfs", 0, "rootfs", NULL);



start_kernel() in init/main.c invokes rest_init() in init/main.c, which starts the init process:

Code:
   kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL);


init() in init/main.c invokes
prepare_namespace() in init/do_mounts.c, which has:

Code:
sys_mkdir("/dev", 0700);
sys_mkdir("/root", 0700);
sys_mknod("/dev/console", S_IFCHR|0600, MKDEV(TTYAUX_MAJOR, 1));

[...]

create_dev("/dev/root", ROOT_DEV, NULL);

[...]

mount_root();


So it looks like things are done in rootfs before mount_root() mounts the real root filesystem, at which point you see the message printed by:

Code:
printk("VFS: Mounted root (%s filesystem)%s.\n",
current->fs->pwdmnt->mnt_sb->s_type->name,
(current->fs->pwdmnt->mnt_sb->s_flags & MS_RDONLY) ? " readonly" : "");
Back to top
View user's profile Send private message 
mpd

Joined: 17 Mar 2006
Posts: 13

PostPosted: Thu 23 Mar 2006, 15:12    Post subject: Re: How to install to Compact Flash directly like Hard Disk  

ant_llias wrote:
I want to install my 512 Mb CF device like hard disk but I want to run / in read only, /var and /tmp in tmpfs, where can I change it, I try in fstab and mtab but it didn't work[/b]


been searching the forum for this...any updates on how to make an IDE-CF install that boots fast like a hard drive 2 install, yet does not write to CF except on reboot if files changed?
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11068
Location: Arizona USA

PostPosted: Thu 23 Mar 2006, 16:32    Post subject:  

http://www.murga.org/~puppy/viewtopic.php?t=6763
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
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.0782s ][ Queries: 11 (0.0027s) ][ GZIP on ]