Re: Loopback mount in fstab fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2019-08-17 at 09:38 +1000, Cameron Simpson wrote:
> On 16Aug2019 13:18, Patrick O'Callaghan <pocallaghan@xxxxxxxxx> wrote:
> > I'm trying to rationalise space by moving my /var directory from its
> > own partition to /, as currently there's a lot of wastage. I've copied
> > /var to /newvar with rsync, and now want to mount /newvar as /var on
> > reboot by creating an entry in /etc/fstab. This is it (using /var-tst
> > for testing):
> > 
> > /newvar                                   /var-tst                ext4    loop            0 0
> 
> That isn't what loop is for. loop is for associating a file with a 
> device.
> 
> What you want is "bind", not "loop", because you're binding an 
> _existing_ mount to another location.
> 
> > but I'm getting:
> > 
> > mount: /var-tst: failed to setup loop device for /newvar.
> 
> Because /var-tst is a directory, not a file-shaped-like-a-partition.

Yes, I finally got that.

> Example from our home server:
> 
>   /app8tb/media/video    /exports/video    none    bind,relatime 0 0
> 
> > PS Suggestions on how to move /var without all this jiggery-pokery are
> > also welcome.
> 
> If you want /var to be on /, rsync it as you have done, and just make a 
> symlink as /var.

That implies overwriting the existing /var directory entry, which is
not possible while the system is running, even in single-user mode.

> Really, all you need to do is to remove the /var fstab entry, umount the 
> existing /var mount, rsync /newvar BACK INTO the stub /var mountpoint 
> which is there, scrub /newvar.

/var cannot be unmounted while the system is running (see above).

I did finally solve it following the suggestion from 
Francis.Montagnac@xxxxxxxx (adding rd.break=pre-pivot to the boot line,
then remounting /sysroot etc.)

> No fstab trickery required (other than erasing/commenting the /var 
> line).
> 
> Then afterwards you need to decide what to do with the partition you 
> have been using for /var.

I'm going to merge it with / (the two are contiguous) but that will
have to be via a live USB stick. I know that doing this with LVM would
be easy (for certain values of "easy") but I gave up on LVM years ago
as it made my head spin :-)

poc
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux