LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-03-2014, 10:22 PM   #1
Scuzzball
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Rep: Reputation: Disabled
live-build hdd persistence not working in qemu


I'm trying to create an image I can put onto a flash drive that has /home mounted read only from an image in the flash drive root. I'm making a liveCD for a game, and would like an easy to modify/update the settings in /home/user/.wine without using live-build.
But the fist step is simple persistence.

Steps I'm using to create the binary.img

As instructed by http://live.debian.net/manual/stable...al.en.html#789
make directory/auto
cp /usr/share/doc/live-build/examples/auto/* directory/auto/
cd directory

edit auto/config to http://pastebin.com/xb8TpRYQ
lb config

As per instructions http://live.debian.net/manual/stable...al.en.html#544
dd if=/dev/null of=config/includes.binary/persistence bs=1 count=0 seek=1G #putting it at config/includes.binary/ means that it's at the root of the image at the end.
/sbin/mkfs.ext4 -F config/includes.binary/persistence
sudo mount -t ext4 config/includes.binary/persistence /mnt/c
sudo echo "/home union" >> /mnt/c/persistence.conf #I don't actually want the union option, but the instructions have it, and it's not working so I'm following instructions exactly
sudo umount /mnt/c
sudo lb clean
sudo lb build

Once it's finished, on windows(Can actually run a VM, unlike laptop) qemu-system-i386.exe E:\live\binary.img
It boots, check mounts with df, nothing about /home or persistence.

Many thanks for any help, been at this specific issue for about a day, with no progress. Doesn't help that live-build takes so long.
 
Old 07-10-2014, 03:25 AM   #2
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
You're forgetting to set the filesystem label to persistence. IIRC that is required.

Code:
/sbin/mkfs.ext4 -L persistence -F config/includes.binary/persistence
In addition, I don't know if you can include the persistence file in the live binary filesystem itself, as it will be mounted read-only at boot time. I'm not 100% sure if that would prevent it from working, however. Fix the label first, then try again, see if that's enough/

Hint: You don't need to rebuild the live image to test out if the label will work.

Unfortunately you cannot (easily) mount the image to modify it. You need to know the offset to the FAT to do so.

Once you mount it, run:

Code:
tune2fs -L persistence /path/to/persistence
and try to boot the image.

Edit:

from man 7 live-boot:

Code:
persistence-label=LABEL
           live-boot will use the name "LABEL" instead of  "persistence"  when
           searching  for persistent storage. LABEL can be any valid filename,
           partition label, or GPT name.
Use blkid to get the filesystem label of the persistence file you created, and then add the above to the bootloader command line (select the entry in syslinux, press [TAB] and add it to the end of the line). See if it works the way you want.

Last edited by goumba; 07-10-2014 at 03:30 AM.
 
Old 07-10-2014, 02:17 PM   #3
Scuzzball
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by goumba View Post
Code:
tune2fs -L persistence /path/to/persistence
So I tried this, but I had to rebuild as I didn't have a binary.img.
Code:
tune2fs -L persistence config/includes.binary/persistence
sudo lb build
qemu binary.img
Didn't work though.

But in the live-build manual, it says that files are identified by filename, so this shouldn't matter.
http://live.debian.net/manual/3.x/ht...al.en.html#537
Quote:
Originally Posted by goumba View Post
In addition, I don't know if you can include the persistence file in the live binary filesystem itself, as it will be mounted read-only at boot time. I'm not 100% sure if that would prevent it from working, however.
This makes some sense, but shouldn't it still try to mount it? Also, I'm fine with it being read only, as the final plan is this is a file I can configure once, and copy to a few different flash drives with the liveOS on it, so I can change the configurations in /home/user without rebuilding the live image.
Also, if it matters, I'm using qemu on linux now, left the country for a study abroad, leaving nicer desktop behind.
 
Old 07-10-2014, 07:39 PM   #4
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by Scuzzball View Post
But in the live-build manual, it says that files are identified by filename, so this shouldn't matter.
http://live.debian.net/manual/3.x/ht...al.en.html#537
This may be a stupid question, but, do you pass persistence to the bootloader at boot time? (Been there, knocked my head against the wall, then discovered I didn't).

From that page,

"The volume label for overlays must be persistence but it will be ignored unless it contains in its root a file named persistence.conf which is used to fully customize the volume's persistence, this is to say, specifying the directories that you want to save in your persistence volume after a reboot. See The persistence.conf file for more details. "

However, their example for creating an image file doesn't include setting a label, so, your guess is as good as mine. Setting the label does not hurt, however.

Quote:
This makes some sense, but shouldn't it still try to mount it? Also, I'm fine with it being read only, as the final plan is this is a file I can configure once, and copy to a few different flash drives with the liveOS on it, so I can change the configurations in /home/user without rebuilding the live image.
Also, if it matters, I'm using qemu on linux now, left the country for a study abroad, leaving nicer desktop behind.
I've never tried mounting an RW filesystem from inside a read-only one, so I'm not sure.

The other thing I have to investigate is if live-boot checks the live medium itself for persistence files, and my guess at the moment is no. The documentation says it checks the root of all partitions for the file, but makes no mention of exclusions or inclusions of certain media. At the moment I don't have the live-boot scripts available, I will have to check later.
 
Old 07-11-2014, 12:11 PM   #5
Scuzzball
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by goumba View Post
This may be a stupid question, but, do you pass persistence to the bootloader at boot time? (Been there, knocked my head against the wall, then discovered I didn't).
Yeah, I am.
Code:
--bootappend-live "boot=live config persistence"
I have tried actually putting this onto a USB drive, and making a persistent partition, and it worked.

Quote:
Setting the label does not hurt, however.
Oh yes, but it didn't help, but whatever. Keeping the modified persistence file for further tests.


Many thanks for your help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiboot External HDD with persistence, of course, please. ProLine_21 Linux - General 7 03-05-2014 02:32 PM
Live usb help; Persistence abcde597 Ubuntu 4 10-23-2012 07:27 PM
Build squeeze live usb-hdd on lenny cccc Debian 3 02-17-2011 09:50 AM
How best to take a working configuration from a live cd and use it for a build? stardotstar Linux - Hardware 3 03-26-2008 08:53 PM
Live CD Persistence ArthurDent Ubuntu 4 10-29-2006 03:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration