{"action":"created","issue":{"url":"https://api.github.com/repos/haraldh/dracut/issues/62","labels_url":"https://api.github.com/repos/haraldh/dracut/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/haraldh/dracut/issues/62/comments","events_url":"https://api.github.com/repos/haraldh/dracut/issues/62/events","html_url":"https://github.com/haraldh/dracut/issues/62","id":76463041,"number":62,"title":"Overlayfs as root filesystem","user":{"login":"chrisnharvey","id":619298,"avatar_url":"https://avatars.githubusercontent.com/u/619298?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisnharvey","html_url":"https://github.com/chrisnharvey","followers_url":"https://api.github.com/users/chrisnharvey/followers","following_url":"https://api.github.com/users/chrisnharvey/following{/other_user}","gists_url":"https://api.github.com/users/chrisnharvey/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisnharvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisnharvey/subscriptions","organizations_url":"https://api.github.com/users/chrisnharvey/orgs","repos_url":"https://api.github.com/users/chrisnharvey/repos","events_url":"https://api.github.com/users/chrisnharvey/events{/privacy}","received_events_url":"https://api.github.com/users/chrisnharvey/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-14T19:23:48Z","updated_at":"2015-05-15T13:09:12Z","closed_at":"2015-05-15T13:09:12Z","body":"Hi,\r\n\r\nI'm currently building a distro for my personal needs which runs on my HDD from a live Fedora ISO. But I'd like to make the filesystem writeable using overlayfs. I'm using https://github.com/probonopd/SystemImageKit which is doing exactly what I want, except persisting data on the same partition.\r\n\r\nSo what I need to do is boot from the ISO on the HDD, this is working fine using SystemImageKit. I then need to use dracut to mount the root filesystem as an overlayfs of the live ISO's root filesystem and a directory on my HDD.\r\n\r\nEssentially what I need to do is the following in the initramfs\r\n\r\n```\r\nmount --move / /os\r\nmount <isodevice> /system\r\nmount -t overlayfs -o lowerdir=/os,upperdir=/system/data overlayfs /\r\n```\r\n\r\nI'm just having trouble moving the root filesystem to another mount point. Then I can mount the HDD as read/write under /system then mount the root filesystem as an overlayfs of /os (original ISO root filesystem) and /system/data (a *real* directory on the HDD which sits alongside /boot).\r\n\r\nIn theory this should work if I can move the root filesystem.\r\n\r\nI've tried this from the terminal my mounting the HDD under /mnt then running:\r\n```\r\nmount -t overlayfs -o lowerdir=/,upperdir=/mnt/data overlayfs /test\r\n```\r\n\r\nThen all my files are then stored in /mnt/data, and are merged with the root filesystem under the /test mount point, which is exactly what I need, but on the root filesystem.\r\n\r\nI just need a way to get this same functionality working but under the root mount point instead of /test."},"comment":{"url":"https://api.github.com/repos/haraldh/dracut/issues/comments/102392930","html_url":"https://github.com/haraldh/dracut/issues/62#issuecomment-102392930","issue_url":"https://api.github.com/repos/haraldh/dracut/issues/62","id":102392930,"user":{"login":"haraldh","id":427825,"avatar_url":"https://avatars.githubusercontent.com/u/427825?v=3","gravatar_id":"","url":"https://api.github.com/users/haraldh","html_url":"https://github.com/haraldh","followers_url":"https://api.github.com/users/haraldh/followers","following_url":"https://api.github.com/users/haraldh/following{/other_user}","gists_url":"https://api.github.com/users/haraldh/gists{/gist_id}","starred_url":"https://api.github.com/users/haraldh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haraldh/subscriptions","organizations_url":"https://api.github.com/users/haraldh/orgs","repos_url":"https://api.github.com/users/haraldh/repos","events_url":"https://api.github.com/users/haraldh/events{/privacy}","received_events_url":"https://api.github.com/users/haraldh/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T13:09:12Z","updated_at":"2015-05-15T13:09:12Z","body":"you could remount /sysroot to /run/sysroot in the dracut mount hook and mount your stuff to /sysroot\r\n\r\n mkdir /run/sysroot; mount --move /sysroot /run/sysroot ... do stuff for /sysroot"}}