On Wed, Dec 09, 2015 at 09:02:25AM +0100, Janne Johansson wrote: > 2015-12-08 21:18 GMT+01:00 Alexander Hall <alexan...@beard.se>: > > > On December 8, 2015 4:21:16 PM GMT+01:00, Otto Moerbeek <o...@drijf.net> > > wrote: > > >On Tue, Dec 08, 2015 at 03:03:14PM +0000, Tati Chevron wrote: > > > > > >> Currently, it's possible, (as root), to do something like: > > >> # mount_mfs -s 1g swap / > > >> > > >> which succeeds, and mounts the empty filesystem as the root > > >filesystem. > > >> This makes the machine inoperable and requires a physical reset, > > >without a clean shutdown, as no system binaries are available. > > >> > > >> Shouldn't we make mount_mfs error out in this case? > > >Why? Unix does not prevent you from doing stupid things in general. > > >Besides, a small variation (using -P) could be a proper and sane use > > >of mount_mfs on / > > > > FWIW, I don't think so, as the mfs is populated after being mounted. > > > > > > > Yeah, mount_mfs will need /bin/pax, and if you give -P a block device, it > will > use /mnt in order to mount the wanted device on so pax can read the files > out > of it, so / and /mnt can't be mfs-mounted upon with -P.
I've been thinking about having mount_mfs mounting the new mfs in some temporary place prior to /bin/pax the lot into it, and then unmount it and mount it into its final destination. I guess I just have not had any use for that yet. :-) /Alexander > > > -- > May the most significant bit of your life be positive.