Re: Memory disk "a la mfsroot"?
Matthew Seaman wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/02/2010 17:10, Pierre-Luc Drouin wrote: Actually, I was thinking more along the lines of mounting a .iso as a cd9660 filesystem. Which won't muck up the underlying .iso, but only because it's read-only. You could mount a FFS image read-only in exactly the same way -- I think there's a 'last mounted on' field in the backing file image that will be updated if the it is writable (even if the fs itself is mounted ro) but that's not the right answer either. Basically, you're going to have to mount and initialise as two separate operations as far as I can see. By this do you mean that I would need to copy the whole content of the read-only filesystem to the memory disk? Yes. I looked at the man page for mount_unionfs and there is a big warning saying that it is a bad idea to use it, so I guess I will pass on this solution... Ah -- that warning is probably a bit more alarming than it really needs to be nowadays. unionfs can be used pretty effectively for many purposes. Try it and see what happens is the best policy. What I am trying to do basically is to mount a filesystem from a CD but I want to use a memory disk to allow write operations. I would basically want the filesystem to behave like a regular read-write filesystem, but not have to copy everything into a memory disk. What does "mfs_root" do exactly in the official FreeBSD boot CDs? Does it copy the content of mfsroot.gz into a memory disk? That filesystem is so small that I guess it can be copied without any problem... mfs_root does exactly that: it creates a memory based filesystem and then expands a tarball of the system into it. One approach you might consider is mounting your CD image read-only as per usual, but creating memory-based /tmp and /var partitions[*]. Most of the usual root and /usr filesystems don't need to be read-write at all. There are only a few special locations that do and those will need special handling. You will need to initialise your memory-backed /var partiton by expanding a skeleton structure into it, but that's going to be pretty small really. You will also need to make provision for editing various files under /etc -- you might be able to create a /var/etc and replace the real files in /etc with symlinks to copies in /var/etc. Possibly. Or you could just have /var/etc nullfs mounted on top of /etc. I've read reports from people setting up such things -- a while back now, but as far as I recall they were on the whole successful. Cheers, Matthew [*] There are already scripts to do this sort of thing within the base system, although primarily aimed at diskless systems. - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt0WDQACgkQ8Mjk52CukIyWgwCeMHjE7VsdHx5HLGQw75SplJ9v 6zUAni7BZsLYsp2qGSFUUMmkjpVMYomt =4SwV -END PGP SIGNATURE- Thanks, so I think I will do the following: 1-Create a mfsroot.gz with empty /usr, /var, /boot/kernel and /boot/modules directories and have it mounted through loader.conf 2-Create a rc.d script that is called immediately after rc.d/conf and that does the following: -Mount /usr using mdmfs and an independent backing file on the CD (so this way the whole content of /usr would not be loaded into RAM) -Create a 500MB memory disk and mount it in /memdisk -Create /memdisk/{var,tmp,root,home,usr} -mount_nullfs /memdisk/var and /memdisk/tmp on /var and /tmp respectively -copy the content of /root and /home (i.e. just a few config files) to their respective directories in /memdisk -mount_nulls /memdisk/root and /memdisk/home on /root and /home respectively -mount_unionfs /memdisk/usr over /usr 3-use populate_var="YES" in rc.conf to automatically populate the /var directory So using this I would have a read-write file system without loading the whole content of /usr into RAM, I would minimize memory usage by regrouping all the writable directories into a single memory disk and I would also minimize the amount of data that is copied from the CD to the memory. Does it sound like a good plan? I read something about a limit of 45MB for mfsroot.gz to prevent kernel crashing. Have you ever heard about this? Thanks! ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Memory disk "a la mfsroot"?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/02/2010 17:10, Pierre-Luc Drouin wrote: >> Actually, I was thinking more along the lines of mounting a .iso as a >> cd9660 filesystem. Which won't muck up the underlying .iso, but only >> because it's read-only. You could mount a FFS image read-only in >> exactly the same way -- I think there's a 'last mounted on' field in the >> backing file image that will be updated if the it is writable (even if >> the fs itself is mounted ro) but that's not the right answer either. >> >> Basically, you're going to have to mount and initialise as two separate >> operations as far as I can see. >> > By this do you mean that I would need to copy the whole content of the > read-only filesystem to the memory disk? Yes. > I looked at the man page for mount_unionfs and there is a big warning > saying that it is a bad idea to use it, so I guess I will pass on this > solution... Ah -- that warning is probably a bit more alarming than it really needs to be nowadays. unionfs can be used pretty effectively for many purposes. Try it and see what happens is the best policy. > What I am trying to do basically is to mount a filesystem from a CD but > I want to use a memory disk to allow write operations. I would basically > want the filesystem to behave like a regular read-write filesystem, but > not have to copy everything into a memory disk. What does "mfs_root" do > exactly in the official FreeBSD boot CDs? Does it copy the content of > mfsroot.gz into a memory disk? That filesystem is so small that I guess > it can be copied without any problem... mfs_root does exactly that: it creates a memory based filesystem and then expands a tarball of the system into it. One approach you might consider is mounting your CD image read-only as per usual, but creating memory-based /tmp and /var partitions[*]. Most of the usual root and /usr filesystems don't need to be read-write at all. There are only a few special locations that do and those will need special handling. You will need to initialise your memory-backed /var partiton by expanding a skeleton structure into it, but that's going to be pretty small really. You will also need to make provision for editing various files under /etc -- you might be able to create a /var/etc and replace the real files in /etc with symlinks to copies in /var/etc. Possibly. Or you could just have /var/etc nullfs mounted on top of /etc. I've read reports from people setting up such things -- a while back now, but as far as I recall they were on the whole successful. Cheers, Matthew [*] There are already scripts to do this sort of thing within the base system, although primarily aimed at diskless systems. - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt0WDQACgkQ8Mjk52CukIyWgwCeMHjE7VsdHx5HLGQw75SplJ9v 6zUAni7BZsLYsp2qGSFUUMmkjpVMYomt =4SwV -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Memory disk "a la mfsroot"?
Matthew Seaman wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/02/2010 15:39, RW wrote: On Thu, 11 Feb 2010 15:12:22 + Matthew Seaman wrote: On 11/02/2010 14:53, Pierre-Luc Drouin wrote: I would like to know if there is a mount command that allows to create a memory disk that can be initialized from a file. What I am looking for is something like mount_mfs -F, but that does not modify the actual file. I know what I could easily to this by copying the content of the file to the memory disk, but I am looking for a solution that can be configured via fstab. Yes. See mdconfig(8) -- there are examples in there of exactly what you want to do. I don't think covers what he is asking for. I think you would need a union filsystem that overlays a swap-backed filesystem on top of a file-backed filesystem - if that's possible. Actually, I was thinking more along the lines of mounting a .iso as a cd9660 filesystem. Which won't muck up the underlying .iso, but only because it's read-only. You could mount a FFS image read-only in exactly the same way -- I think there's a 'last mounted on' field in the backing file image that will be updated if the it is writable (even if the fs itself is mounted ro) but that's not the right answer either. Basically, you're going to have to mount and initialise as two separate operations as far as I can see. By this do you mean that I would need to copy the whole content of the read-only filesystem to the memory disk? I looked at the man page for mount_unionfs and there is a big warning saying that it is a bad idea to use it, so I guess I will pass on this solution... What I am trying to do basically is to mount a filesystem from a CD but I want to use a memory disk to allow write operations. I would basically want the filesystem to behave like a regular read-write filesystem, but not have to copy everything into a memory disk. What does "mfs_root" do exactly in the official FreeBSD boot CDs? Does it copy the content of mfsroot.gz into a memory disk? That filesystem is so small that I guess it can be copied without any problem... Thanks! Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt0KDsACgkQ8Mjk52CukIxZaACcCIsHKNBckWDFzRWDJqEH/vVC Pd4AnRp74n7+Jl+z28VwBEYqpfQmNVJ0 =lxug -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Memory disk "a la mfsroot"?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/02/2010 15:39, RW wrote: > On Thu, 11 Feb 2010 15:12:22 + > Matthew Seaman wrote: >> On 11/02/2010 14:53, Pierre-Luc Drouin wrote: >> >>> I would like to know if there is a mount command that allows to >>> create a memory disk that can be initialized from a file. What I am >>> looking for is something like mount_mfs -F, but that does not >>> modify the actual file. I know what I could easily to this by >>> copying the content of the file to the memory disk, but I am >>> looking for a solution that can be configured via fstab. >> >> Yes. See mdconfig(8) -- there are examples in there of exactly what >> you want to do. > > I don't think covers what he is asking for. I think you would need a > union filsystem that overlays a swap-backed filesystem on top of a > file-backed filesystem - if that's possible. Actually, I was thinking more along the lines of mounting a .iso as a cd9660 filesystem. Which won't muck up the underlying .iso, but only because it's read-only. You could mount a FFS image read-only in exactly the same way -- I think there's a 'last mounted on' field in the backing file image that will be updated if the it is writable (even if the fs itself is mounted ro) but that's not the right answer either. Basically, you're going to have to mount and initialise as two separate operations as far as I can see. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt0KDsACgkQ8Mjk52CukIxZaACcCIsHKNBckWDFzRWDJqEH/vVC Pd4AnRp74n7+Jl+z28VwBEYqpfQmNVJ0 =lxug -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Memory disk "a la mfsroot"?
On Thu, 11 Feb 2010 15:12:22 + Matthew Seaman wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 11/02/2010 14:53, Pierre-Luc Drouin wrote: > > > I would like to know if there is a mount command that allows to > > create a memory disk that can be initialized from a file. What I am > > looking for is something like mount_mfs -F, but that does not > > modify the actual file. I know what I could easily to this by > > copying the content of the file to the memory disk, but I am > > looking for a solution that can be configured via fstab. > > Yes. See mdconfig(8) -- there are examples in there of exactly what > you want to do. I don't think covers what he is asking for. I think you would need a union filsystem that overlays a swap-backed filesystem on top of a file-backed filesystem - if that's possible. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Memory disk "a la mfsroot"?
Matthew Seaman wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/02/2010 14:53, Pierre-Luc Drouin wrote: I would like to know if there is a mount command that allows to create a memory disk that can be initialized from a file. What I am looking for is something like mount_mfs -F, but that does not modify the actual file. I know what I could easily to this by copying the content of the file to the memory disk, but I am looking for a solution that can be configured via fstab. Yes. See mdconfig(8) -- there are examples in there of exactly what you want to do. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt0HlYACgkQ8Mjk52CukIyprwCfQj9DwqHtLoDx2ZWCrhglFDfH dR4AoIEw3CyS2zPajdi4PLGC7aLHj5aI =Xr7U -END PGP SIGNATURE- I might be missing something in the mdconfig man page, but in the examples I see they always allow modifications to the backing file. As I said I am looking for a solution where the backing file is only read, but I want to mount the memory disk in read-write mode. Also, I want only the modifications to be kept in the RAM, not the initial files. Thanks! ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Memory disk "a la mfsroot"?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/02/2010 14:53, Pierre-Luc Drouin wrote: > I would like to know if there is a mount command that allows to create a > memory disk that can be initialized from a file. What I am looking for > is something like mount_mfs -F, but that does not modify the actual > file. I know what I could easily to this by copying the content of the > file to the memory disk, but I am looking for a solution that can be > configured via fstab. Yes. See mdconfig(8) -- there are examples in there of exactly what you want to do. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt0HlYACgkQ8Mjk52CukIyprwCfQj9DwqHtLoDx2ZWCrhglFDfH dR4AoIEw3CyS2zPajdi4PLGC7aLHj5aI =Xr7U -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Memory disk
Ok, I'll try to answer both all in one go. hopefully others will turn up good links. googling for some of the ideas I'm mentioning will be your friend On Wednesday 12 February 2003 10:19 pm, Walter wrote: > Steve Bertrand wrote: > > The reason for this is so I can make my boxes much smaller and much > > faster (no hdd i/o). > > > > 1. Is it possible to do a custom r/o install of Free onto a CD? yes. it's called makiing a release. see: http://www.freebsd.org/doc/en_US.ISO8859-1/articles/releng/release-build.html and man release > > 2. Is it possible to run FreeBSd out of memory with no hdd? yes. it would be running on a ramdisk. search the archives, there have been many conversations about the best way to do that. Maybe mfs is what you're looking for: man mfs > > This is a novice wondering out loud: To keep things > small, is it possible to use the new memory cards > (for digital cameras) instead of a hard drive? The yes. look for a compact flash - IDE adapter. You can then run off of a comapct flash card. Tim To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Memory disk
On Wed, 12 Feb 2003, Steve Bertrand wrote: > 1. Is it possible to do a custom r/o install of Free onto a CD? > 2. Is it possible to run FreeBSd out of memory with no hdd? Yes, see these resources: man picobsd http://www.freesbie.org -Warren Block * Rapid City, South Dakota USA To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Memory disk
Steve Bertrand wrote: >1. Is it possible to do a custom r/o install of Free onto a CD? >2. Is it possible to run FreeBSd out of memory with no hdd? possibly try this article: http://www.bsdtoday.com/2002/March/Features646.html To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Memory disk
Steve Bertrand wrote: The reason for this is so I can make my boxes much smaller and much faster (no hdd i/o). 1. Is it possible to do a custom r/o install of Free onto a CD? 2. Is it possible to run FreeBSd out of memory with no hdd? This is a novice wondering out loud: To keep things small, is it possible to use the new memory cards (for digital cameras) instead of a hard drive? The capacity on those is getting pretty large. Then you could drop even the CD. (I hoping to see them completely replace floppies, even as a boot device, some day.) Walter To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message