Welcome
Welcome to refracta

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Load to RAM option at Boot

Ask your questions here.

Load to RAM option at Boot

Postby miyolinux » Tue Jan 24, 2017 1:32 am

First, let me say thanks for the "Load to RAM" option included in the Grub screen with RefractaSnapshot! It has worked great each time I've tried it! :)

Now to embarrass myself... :oops: :D

When booting from a USB and choosing the "Load to RAM" option...what is the correct method for removing the USB after the desktop has loaded? All that I've been doing is just removing the USB without trying to unmount it via the terminal or anything. So far, that has worked fine.

Thanks for any input!
miyolinux
 
Posts: 40
Joined: Tue Oct 25, 2016 2:45 am

Re: Load to RAM option at Boot

Postby dzz » Tue Jan 24, 2017 2:02 am

Never tried that, nothing here with enough RAM..

Code: Select all
cat /proc/mounts


will show if your live-media device is still mounted somewhere, if not feel free to pull it out. If it is, it's a live-boot bug. Please post back with what you find.
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Load to RAM option at Boot

Postby miyolinux » Tue Jan 24, 2017 2:19 am

dzz wrote:Never tried that, nothing here with enough RAM..

Code: Select all
cat /proc/mounts


will show if your live-media device is still mounted somewhere, if not feel free to pull it out. If it is, it's a live-boot bug. Please post back with what you find.


Thanks for the quick reply dzz! I wasn't expecting one so soon. After seeing your reply, I booted from the USB. Here's the output from the command you gave. From what I see, and unless I'm overlooking something...there's nothing showing that the USB is still mounted...please let me know if I'm missing something in what I've deduced.

Code: Select all
rootfs / rootfs rw,size=1928304k,nr_inodes=208810 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=388524k,mode=755 0 0
/dev/shm /lib/live/mount/medium tmpfs rw,relatime,size=513848k 0 0
/dev/loop0 /lib/live/mount/rootfs/filesystem.squashfs squashfs ro,noatime 0 0
tmpfs /lib/live/mount/overlay tmpfs rw,relatime 0 0
tmpfs /lib/live/mount/overlay tmpfs rw,noatime,mode=755 0 0
aufs / aufs rw,noatime,si=31dc9b2e,noxino 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
pstore /sys/fs/pstore pstore rw,relatime 0 0
devtmpfs /dev devtmpfs rw,relatime,size=10240k,nr_inodes=208815,mode=755 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=777040k 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
gvfsd-fuse /home/miyolinux/.gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
Last edited by miyolinux on Tue Jan 24, 2017 3:45 am, edited 1 time in total.
miyolinux
 
Posts: 40
Joined: Tue Oct 25, 2016 2:45 am

Re: Load to RAM option at Boot

Postby dzz » Tue Jan 24, 2017 3:35 am

(better to post that in a code box) but looks like it's not mounted, no /dev/sd_anything. It shouldn't be, that's the whole point of "toram".
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Load to RAM option at Boot

Postby miyolinux » Tue Jan 24, 2017 3:45 am

dzz wrote:(better to post that in a code box) but looks like it's not mounted, no /dev/sd_anything. It shouldn't be, that's the whole point of "toram".


Fixed it. Sorry...and thank you. :)
miyolinux
 
Posts: 40
Joined: Tue Oct 25, 2016 2:45 am

Re: Load to RAM option at Boot

Postby fsmithred » Tue Jan 24, 2017 4:06 am

Just pull it out. Tested here a few minutes ago. If you plug it back in, you can mount/unmount it just like you would any other usb stick. It's not part of the running system at that point.

What I'd like to do (topic for another thread if I knew enough to say anything intelligent about it) is fix it so that if you boot a multiboot usb toram, it would only copy the system you want to boot instead of copying the whole first partition to ram. Where do the live-boot scripts get their arguments (like copyfrom="$2")?
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Load to RAM option at Boot

Postby dzz » Tue Jan 24, 2017 5:21 pm

Posting from the latest refracta32 live (findiso, toram, swap) located on a multiboot, 64G single-FAT sandisk usb. Old vaio netbook with 1G ram. Only the contents of the iso image were copied to RAM (not the partition, which could not possible fit). The usb was not mounted and has been pulled out.

Code: Select all
[email protected]:~$ free -m
             total       used       free     shared    buffers     cached
Mem:           998        916         81        518         37        627
-/+ buffers/cache:        251        746
Swap:         2098        221       1877

Relying on swap but performing better than expected..

Where do the live-boot scripts get their arguments (like copyfrom="$2")?

I sure don't have a full understanding of it all. There are 20 scripts in /lib/live/boot. A function in one may get called from another. It's required arguments (e.g. where is the squashfs, what other boot parameters) vary from one system to another so must be detected. Look in 9990-main.sh ..
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Load to RAM option at Boot

Postby dzz » Thu Jan 26, 2017 1:10 pm

if you boot a multiboot usb toram, it would only copy the system you want to boot instead of copying the whole first partition to ram.

fsmithred, I now see what you mean. I tried booting toram from the extracted squashfs (live-media-path=). It failed with "not enough ram" errors, then continued booting from the usb.

However what I posted earlier still appears true, toram with "findiso" copies the iso image contents only to ram.

Code: Select all
[email protected]:~$ ls /lib/live/mount/medium
isolinux  live  pkglist_refracta8_xfce_i386-20161014_1432

Here's the debug log (/var/log/live/boot.log) confirming what happens:

Code: Select all
+ tailpid=105
+ cat /proc/cmdline
+ LIVE_BOOT_CMDLINE=initrd=/refracta8/initrd.img findiso=/refracta8/refracta8_xfce_i386-20161014_1432.iso boot=live union=aufs nomce apm=power-off nocomponents=xinit locales=en_GB.UTF-8 mountmode=rw,noatime swap toram debug
+ Cmdline_old
+ FINDISO=/refracta8/refracta8_xfce_i386-20161014_1432.iso
+ export FINDISO
+ UNIONTYPE=aufs
+ export UNIONTYPE
+ TORAM=true
+ export TORAM
+ [ -z  ]
+ [  = /dev/nfs ]
+ [  = /dev/cifs ]
+ [ -z  ]
+ MODULE=filesystem
+ export MODULE
+ [ -z aufs ]
+ [ -z  ]
+ PERSISTENCE_ENCRYPTION=none
+ export PERSISTENCE_ENCRYPTION
+ [ -z  ]
+ PERSISTENCE_METHOD=overlay
+ export PERSISTENCE_METHOD
+ [ -z  ]
+ PERSISTENCE_STORAGE=filesystem,file
+ export PERSISTENCE_STORAGE
+ Debug
+ LIVE_BOOT_DEBUG=true
+ set -x
+ Read_only
+ return 0
+ Select_eth_device
+ tail -f boot.log
+ tail -1
+ egrep ^BOOT= /conf/initramfs.conf
+ bootconf=
+ [  != BOOT=nfs ]
+ [ -z  ]
+ [ -z  ]
+ [ -z  ]
+ [ -z  ]
+ return
+ [ -e /conf/param.conf ]
+ [ ! -z  ]
+ [ ! -z  ]
+ [ ! -z  ]
+ [ ! -z  ]
+ [ -n  ]
+ [ -n  ]
+ [ -x /usr/bin/memdiskfind ]
+ i=0
+ [ 0 -lt 60 ]
+ find_livefs 0
+ timeout=0
+ [ -n  ]
+ [ ! -z  ]
+ removable_dev sys
+ output_format=sys
+ want_usb=
+ ret=
+ grep -vE /(loop|ram|dm-|fd)
+ tr   \n
+ echo /sys/block/sda /sys/block/sdb /sys/block/sr0
+ dev_ok=
+ cat /sys/block/sda/removable
+ [ 0 = 1 ]
+ [  = true ]
+ dev_ok=
+ cat /sys/block/sdb/removable
+ [ 1 = 1 ]
+ [ -z  ]
+ dev_ok=true
+ [ true = true ]
+ ret= /sys/block/sdb
+ dev_ok=
+ cat /sys/block/sr0/removable
+ [ 1 = 1 ]
+ [ -z  ]
+ dev_ok=true
+ [ true = true ]
+ ret= /sys/block/sdb /sys/block/sr0
+ echo  /sys/block/sdb /sys/block/sr0
+ non_removable_dev sys
+ output_format=sys
+ ret=
+ grep -vE /(loop|ram|dm-|fd)
+ tr   \n
+ echo /sys/block/sda /sys/block/sdb /sys/block/sr0
+ cat /sys/block/sda/removable
+ [ 0 = 0 ]
+ ret= /sys/block/sda
+ cat /sys/block/sdb/removable
+ [ 1 = 0 ]
+ cat /sys/block/sr0/removable
+ [ 1 = 0 ]
+ echo  /sys/block/sda
+ devices_to_scan= /sys/block/sdb /sys/block/sr0  /sys/block/sda
+ sys2dev /sys/block/sdb
+ sysdev=/block/sdb
+ udevadm info -q name -p /block/sdb
+ echo /dev/sdb
+ devname=/dev/sdb
+ [ -e /dev/sdb ]
+ get_fstype /dev/sdb
+ local FS FSTYPE FSSIZE RET
+ FS=/dev/sdb
+ FSTYPE=unknown
+ fstype /dev/sdb
+ eval FSTYPE=unknown FSSIZE=0
+ FSTYPE=unknown FSSIZE=0
+ [ unknown = unknown ]
+ command -v blkid
+ blkid -o value -s TYPE /dev/sdb
+ FSTYPE=
+ RET=0
+ [ -z  ]
+ FSTYPE=unknown
+ echo unknown
+ return 0
+ fstype=unknown
+ /lib/udev/cdrom_id /dev/sdb
+ is_nice_device /sys/block/sdb
+ sysfs_path=/block/sdb
+ egrep -q DEVTYPE=disk
+ udevadm info --query=all --path=/block/sdb
calling: info
+ return 0
+ subdevices /sys/block/sdb
+ sysblock=/sys/block/sdb
+ r=
+ [ -e /sys/block/sdb/alignment_offset/dev ]
+ [ -e /sys/block/sdb/bdi/dev ]
+ [ -e /sys/block/sdb/capability/dev ]
+ [ -e /sys/block/sdb/dev/dev ]
+ [ -e /sys/block/sdb/device/dev ]
+ [ -e /sys/block/sdb/discard_alignment/dev ]
+ [ -e /sys/block/sdb/events/dev ]
+ [ -e /sys/block/sdb/events_async/dev ]
+ [ -e /sys/block/sdb/events_poll_msecs/dev ]
+ [ -e /sys/block/sdb/ext_range/dev ]
+ [ -e /sys/block/sdb/holders/dev ]
+ [ -e /sys/block/sdb/inflight/dev ]
+ [ -e /sys/block/sdb/power/dev ]
+ [ -e /sys/block/sdb/queue/dev ]
+ [ -e /sys/block/sdb/range/dev ]
+ [ -e /sys/block/sdb/removable/dev ]
+ [ -e /sys/block/sdb/ro/dev ]
+ [ -e /sys/block/sdb/sdb1/dev ]
+ r= /sys/block/sdb/sdb1
+ [ -e /sys/block/sdb/size/dev ]
+ [ -e /sys/block/sdb/slaves/dev ]
+ [ -e /sys/block/sdb/stat/dev ]
+ [ -e /sys/block/sdb/subsystem/dev ]
+ [ -e /sys/block/sdb/trace/dev ]
+ [ -e /sys/block/sdb/uevent/dev ]
+ [ -e /sys/block/sdb/dev ]
+ r= /sys/block/sdb/sdb1 /sys/block/sdb
+ echo /sys/block/sdb/sdb1 /sys/block/sdb
+ check_dev /sys/block/sdb/sdb1
+ sysdev=/sys/block/sdb/sdb1
+ devname=
+ skip_uuid_check=
+ [ -n  ]
+ [ -z  ]
+ sys2dev /sys/block/sdb/sdb1
+ sysdev=/block/sdb/sdb1
+ udevadm info -q name -p /block/sdb/sdb1
+ echo /dev/sdb1
+ devname=/dev/sdb1
+ [ -d /dev/sdb1 ]
+ IFS=,
+ unset IFS
+ [ -n /dev/sdb1 ]
+ devname=/dev/sdb1
+ [ -e /dev/sdb1 ]
+ [ -n  ]
+ get_fstype /dev/sdb1
+ local FS FSTYPE FSSIZE RET
+ FS=/dev/sdb1
+ FSTYPE=unknown
+ fstype /dev/sdb1
+ eval FSTYPE=unknown FSSIZE=0
+ FSTYPE=unknown FSSIZE=0
+ [ unknown = unknown ]
+ command -v blkid
+ blkid -o value -s TYPE /dev/sdb1
+ FSTYPE=vfat
+ RET=0
+ [ -z vfat ]
+ echo vfat
+ return 0
+ fstype=vfat
+ is_supported_fs vfat
+ fstype=vfat
+ [ -z vfat ]
+ grep -q vfat /proc/filesystems
+ modprobe -q -b vfat
+ grep -q vfat /proc/filesystems
+ return 0
+ blkid -o value -s UUID /dev/sdb1
+ devuid=5FF6-05EB
+ [ -n 5FF6-05EB ]
+ grep -qs \<5FF6-05EB\> /var/lib/live/boot/devices-already-tried-to-mount
+ mount -t vfat -o ro,noatime /dev/sdb1 /live/medium
+ is_live_path /live/medium
+ DIRECTORY=/live/medium/live
+ ls /live/medium/live/filesystem.squashfs
+ return 0
+ [ -n rw,noatime ]
+ [ vfat = vfat ]
+ custom_mountopts=rw,noatime,umask=000
+ umount /live/medium
+ mount -t vfat -o rw,noatime,umask=000 /dev/sdb1 /live/medium
+ [ -n 5FF6-05EB ]
+ echo 5FF6-05EB
+ [ -n /refracta8/refracta8_xfce_i386-20161014_1432.iso ]
+ [ -f /live/medium//refracta8/refracta8_xfce_i386-20161014_1432.iso ]
+ umount /live/medium
+ mkdir -p /live/findiso
+ mount -t vfat -o ro,noatime /dev/sdb1 /live/findiso
+ [ -n rw,noatime ]
+ [ vfat = vfat ]
+ custom_mountopts=rw,noatime,umask=000
+ umount /live/findiso
+ mount -t vfat -o rw,noatime,umask=000 /dev/sdb1 /live/findiso
+ setup_loop /live/findiso//refracta8/refracta8_xfce_i386-20161014_1432.iso loop /sys/block/loop* 0
+ local fspath module pattern offset encryption readonly
+ fspath=/live/findiso//refracta8/refracta8_xfce_i386-20161014_1432.iso
+ module=loop
+ pattern=/sys/block/loop*
+ offset=0
+ encryption=
+ readonly=
+ modprobe -q -b loop
+ udevadm settle
calling: settle
+ cat /sys/block/loop0/size
+ [ 0 -eq 0 ]
+ sys2dev /sys/block/loop0
+ sysdev=/block/loop0
+ udevadm info -q name -p /block/loop0
+ echo /dev/loop0
+ dev=/dev/loop0
+ options=
+ [ -n  ]
+ [ -n 0 ]
+ [ 0 -lt 0 ]
+ [ -z  ]
+ losetup /dev/loop0 /live/findiso//refracta8/refracta8_xfce_i386-20161014_1432.iso
+ echo /dev/loop0
+ return 0
+ loopdevname=/dev/loop0
+ devname=/dev/loop0
+ mount -t iso9660 -o ro,noatime /dev/loop0 /live/medium
+ is_live_path /live/medium
+ DIRECTORY=/live/medium/live
+ ls /live/medium/live/filesystem.squashfs
+ return 0
+ [  ]
+ matches_uuid /live/medium
+ [  ]
+ [ ! -e /conf/uuid.conf ]
+ return 0
+ echo /live/medium
+ return 0
+ return 0
+ livefs_root=/live/medium
+ [ -n /live/medium ]
+ break
+ [ -z /live/medium ]
+ Verify_checksums /live/medium
+ return 0
+ [ true ]
+ live_dest=ram
+ [ ram ]
+ log_begin_msg Copying live media to ram
+ _log_msg Begin: Copying live media to ram ...
+ [ n = y ]
+ printf Begin: Copying live media to ram ...
Begin: Copying live media to ram ... + copy_live_to /live/medium ram
+ copyfrom=/live/medium
+ copytodev=ram
+ copyto=/live/medium_swap
+ [ -z  ]
+ fs_size  /live/medium/ used
+ dev=
+ mountp=/live/medium/
+ used=used
+ [ -z /live/medium/ ]
+ [ used = used ]
+ cut -f1
+ du -ks /live/medium/
+ size=652387
+ expr 652387 + 652387 / 20
+ size=685006
+ [ -n  ]
+ echo 685006
+ size=685006
+ [ ram = ram ]
+ awk /^MemFree:/{f=$2} /^Cached:/{c=$2} END{print f+c} /proc/meminfo
+ freespace=1005480
+ mount_options=-o size=685006k
+ free_string=memory
+ fstype=tmpfs
+ dev=/dev/shm
+ [ 1005480 -lt 685006 ]
+ [ -z -o size=685006k ]
+ mkdir /live/medium_swap
+ log_begin_msg mount -t tmpfs -o size=685006k /dev/shm /live/medium_swap
+ _log_msg Begin: mount -t tmpfs -o size=685006k /dev/shm /live/medium_swap ...
+ [ n = y ]
+ printf Begin: mount -t tmpfs -o size=685006k /dev/shm /live/medium_swap ...
Begin: mount -t tmpfs -o size=685006k /dev/shm /live/medium_swap ... + mount -t tmpfs -o size=685006k /dev/shm /live/medium_swap
+ [  = tgz ]
+ [ -n  ]
+ [ -x /bin/rsync ]
+ echo  * Copying whole medium to RAM
+ rsync -a --progress /live/medium/isolinux /live/medium/live /live/medium/pkglist_refracta8_xfce_i386-20161014_1432 /live/medium_swap
+ umount /live/medium
+ mount -r -o move /live/medium_swap /live/medium
+ rmdir /live/medium_swap
+ return 0
+ log_end_msg
+ _log_msg done.\n
+ [ n = y ]
+ printf done.\n
done.
+ [ -n  ]
+ [ -n  ]
+ [ -n  ]
+ get_mac
+ mac=
+ cat /sys/class/net/eth0/iflink
+ status=2
+ [ 2 -eq 2 ]
+ cat /sys/class/net/eth0/address
+ mac=00:13:a9:8c:c5:8c
+ tr [a-z] [A-Z]
+ sed s/:/-/g
+ echo 00:13:a9:8c:c5:8c
+ mac=00-13-A9-8C-C5-8C
+ cat /sys/class/net/lo/iflink
+ status=1
+ [ 1 -eq 2 ]
+ echo 00-13-A9-8C-C5-8C
+ mac=00-13-A9-8C-C5-8C
+ sed s/-//g
+ echo 00-13-A9-8C-C5-8C
+ mac=0013A98CC58C
+ mount_images_in_directory /live/medium /root 0013A98CC58C
+ directory=/live/medium
+ rootmnt=/root
+ mac=0013A98CC58C
+ is_live_path /live/medium
+ DIRECTORY=/live/medium/live
+ ls /live/medium/live/filesystem.squashfs
+ return 0
+ [ -n 0013A98CC58C ]
+ adddirectory=/live/medium/live/0013A98CC58C
+ setup_unionfs /live/medium/live /root /live/medium/live/0013A98CC58C
+ image_directory=/live/medium/live
+ rootmnt=/root
+ addimage_directory=/live/medium/live/0013A98CC58C
+ modprobe -q -b aufs
+ grep -q ^aufs$
+ cut -f2 /proc/filesystems
+ croot=/
+ rootfslist=
+ [ -z  ]
+ [ -e /live/medium/live/filesystem.filesystem.module ]
+ [ -e /live/medium/live/filesystem.module ]
+ [ -e /live/medium/live/filesystem.squashfs ]
+ image_string= /live/medium/live/filesystem.squashfs
+ [ -e /live/medium/live/*.ext2 ]
+ [ -e /live/medium/live/*.ext3 ]
+ [ -e /live/medium/live/*.ext4 ]
+ [ -e /live/medium/live/*.xfs ]
+ [ -e /live/medium/live/*.jffs2 ]
+ [ -e /live/medium/live/*.dir ]
+ [ -n /live/medium/live/0013A98CC58C ]
+ [ -d /live/medium/live/0013A98CC58C ]
+ sort
+ sed -e s/ /\n/g
+ echo /live/medium/live/filesystem.squashfs
+ image_string=/live/medium/live/filesystem.squashfs
+ [ -n  ]
+ mkdir -p /
+ basename /live/medium/live/filesystem.squashfs
+ imagename=filesystem.squashfs
+ export image devname
+ maybe_break live-realpremount
+ [  = live-realpremount ]
+ log_begin_msg Running /scripts/live-realpremount
+ _log_msg Begin: Running /scripts/live-realpremount ...
+ [ n = y ]
+ printf Begin: Running /scripts/live-realpremount ...
Begin: Running /scripts/live-realpremount ... + run_scripts /scripts/live-realpremount
+ initdir=/scripts/live-realpremount
+ [ ! -d /scripts/live-realpremount ]
+ return
+ log_end_msg
+ _log_msg done.\n
+ [ n = y ]
+ printf done.\n
done.
+ [ -d /live/medium/live/filesystem.squashfs ]
+ [ -f /live/medium/live/filesystem.squashfs ]
+ grep -q -- -r\b
+ losetup --help
+ get_backing_device /live/medium/live/filesystem.squashfs -r
+ setup_loop /live/medium/live/filesystem.squashfs loop /sys/block/loop* 0  -r
+ local fspath module pattern offset encryption readonly
+ fspath=/live/medium/live/filesystem.squashfs
+ module=loop
+ pattern=/sys/block/loop*
+ offset=0
+ encryption=
+ readonly=-r
+ modprobe -q -b loop
+ udevadm settle
calling: settle
+ cat /sys/block/loop0/size
+ [ 0 -eq 0 ]
+ sys2dev /sys/block/loop0
+ sysdev=/block/loop0
+ udevadm info -q name -p /block/loop0
+ echo /dev/loop0
+ dev=/dev/loop0
+ options=
+ [ -n -r ]
+ grep -q -- -r\b
+ losetup --help
+ options= -r
+ [ -n 0 ]
+ [ 0 -lt 0 ]
+ [ -z  ]
+ losetup -r /dev/loop0 /live/medium/live/filesystem.squashfs
+ echo /dev/loop0
+ return 0
+ echo /dev/loop0
+ backdev=/dev/loop0
+ get_fstype /dev/loop0
+ local FS FSTYPE FSSIZE RET
+ FS=/dev/loop0
+ FSTYPE=unknown
+ fstype /dev/loop0
+ eval FSTYPE=squashfs FSSIZE=161971149055
+ FSTYPE=squashfs FSSIZE=161971149055
+ [ squashfs = unknown ]
+ [ squashfs = unknown ]
+ RET=0
+ [ -z squashfs ]
+ echo squashfs
+ return 0
+ fstype=squashfs
+ mpoint=//filesystem.squashfs
+ rootfslist=//filesystem.squashfs
+ mkdir -p //filesystem.squashfs
+ log_begin_msg Mounting "/live/medium/live/filesystem.squashfs" on "//filesystem.squashfs" via "/dev/loop0"
+ _log_msg Begin: Mounting "/live/medium/live/filesystem.squashfs" on "//filesystem.squashfs" via "/dev/loop0" ...
+ [ n = y ]
+ printf Begin: Mounting "/live/medium/live/filesystem.squashfs" on "//filesystem.squashfs" via "/dev/loop0" ...
Begin: Mounting "/live/medium/live/filesystem.squashfs" on "//filesystem.squashfs" via "/dev/loop0" ... + mount -t squashfs -o ro,noatime /dev/loop0 //filesystem.squashfs
+ log_end_msg
+ _log_msg done.\n
+ [ n = y ]
+ printf done.\n
done.
+ touch /etc/fstab
+ mkdir -p /live/overlay
+ mount -t tmpfs tmpfs /live/overlay
+ [ -n  ]
+ [ -n  ]
+ [ -z  ]
+ cowdevice=tmpfs
+ cow_fstype=tmpfs
+ cow_mountopt=rw,noatime,mode=755
+ [ aufs != unionmount ]
+ [ -n  ]
+ root_backing=/live/overlay
+ [ tmpfs = nfs ]
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs /live/overlay
+ wc -w
+ echo //filesystem.squashfs
+ rootfscount=1
+ rootfs=//filesystem.squashfs
+ [ -n  ]
+ cow_dirs=/
+ [ tmpfs != tmpfs ]
+ unionmountpoint=/root/
+ mkdir -p /root/
+ [ aufs = unionmount ]
+ cow_dir=/live/overlay/
+ rootfs_dir=//filesystem.squashfs/
+ mkdir -p /live/overlay/
+ [ -n  ]
+ do_union /root/ /live/overlay/ //filesystem.squashfs/
+ local unionmountpoint unionrw unionro
+ unionmountpoint=/root/
+ shift
+ unionrw=/live/overlay/
+ shift
+ unionro=//filesystem.squashfs/
+ rw_opt=rw
+ ro_opt=rr+wh
+ noxino_opt=noxino
+ unionmountopts=-o noatime,noxino,dirs=/live/overlay/=rw
+ [ -n //filesystem.squashfs/ ]
+ unionmountopts=-o noatime,noxino,dirs=/live/overlay/=rw://filesystem.squashfs/=rr+wh
+ mount -t aufs -o noatime,noxino,dirs=/live/overlay/=rw://filesystem.squashfs/=rr+wh aufs /root/
+ chmod 0755 /root
+ [ -d /root/tmp ]
+ chmod 1777 /root/tmp
+ live_rootfs_list=
+ live_rootfs=/live/rootfs/filesystem.squashfs
+ live_rootfs_list= /live/rootfs/filesystem.squashfs
+ mkdir -p /live/rootfs/filesystem.squashfs
+ mount -o move //filesystem.squashfs /live/rootfs/filesystem.squashfs
+ [ -n  ]
+ umount /live/overlay
+ true
+ grep -e ^/live/
+ cut -f 2 -d 
+ cat /proc/mounts
+ local newmount
+ newmount=/root/lib/live/mount/findiso
+ mkdir -p /root/lib/live/mount/findiso
+ mount -o move /live/findiso /root/lib/live/mount/findiso
+ local newmount
+ newmount=/root/lib/live/mount/medium
+ mkdir -p /root/lib/live/mount/medium
+ mount -o move /live/medium /root/lib/live/mount/medium
+ local newmount
+ newmount=/root/lib/live/mount/rootfs/filesystem.squashfs
+ mkdir -p /root/lib/live/mount/rootfs/filesystem.squashfs
+ mount -o move /live/rootfs/filesystem.squashfs /root/lib/live/mount/rootfs/filesystem.squashfs
+ local newmount
+ newmount=/root/lib/live/mount/overlay
+ mkdir -p /root/lib/live/mount/overlay
+ mount -o move /live/overlay /root/lib/live/mount/overlay
+ local newmount
+ newmount=/root/lib/live/mount/overlay
+ mkdir -p /root/lib/live/mount/overlay
+ mount -o move /live/overlay /root/lib/live/mount/overlay
+ [ -n  ]
+ log_end_msg
+ _log_msg done.\n
+ [ n = y ]
+ printf done.\n
done.
+ ls /root/bin /root/boot /root/data /root/dev /root/etc /root/home /root/initrd.img /root/lib /root/lost+found /root/media /root/mnt /root/opt /root/proc /root/root /root/run /root/sbin /root/srv /root/sys /root/tmp /root/usr /root/var /root/vmlinuz
+ [ -n /refracta8/refracta8_xfce_i386-20161014_1432.iso ]
+ [ true ]
+ losetup -d /dev/loop0
+ is_mountpoint /root/lib/live/mount/findiso
+ directory=/root/lib/live/mount/findiso
+ stat -fc%d:%D /root/lib/live/mount/findiso
+ stat -fc%d:%D /root/lib/live/mount/findiso/..
+ [ 0:D != 127748:D ]
+ umount /root/lib/live/mount/findiso
+ rmdir --ignore-fail-on-non-empty /root/lib/live/mount/findiso
+ [ -L /root/etc/resolv.conf ]
+ DNSFILE=/root/etc/resolv.conf
+ [ -f /etc/resolv.conf ]
+ [ -d /lib/live/boot ]
+ Fstab
+ . /scripts/functions
+ . /lib/live/boot/9990-initramfs-tools.sh
+ [ -n  ]
+ log_begin_msg Configuring fstab
+ _log_msg Begin: Configuring fstab ...
+ [ n = y ]
+ printf Begin: Configuring fstab ...
Begin: Configuring fstab ... + grep -qs ^aufs /root/etc/fstab
+ echo aufs / aufs rw 0 0
+ grep -qs ^tmpfs /tmp /root/etc/fstab
+ echo tmpfs /tmp tmpfs nosuid,nodev 0 0
+ log_end_msg
+ _log_msg done.\n
+ [ n = y ]
+ printf done.\n
done.
+ Netbase
+ [ -n  ]
+ . /scripts/functions
+ . /lib/live/boot/9990-initramfs-tools.sh
+ log_begin_msg Preconfiguring networking
+ _log_msg Begin: Preconfiguring networking ...
+ [ n = y ]
+ printf Begin: Preconfiguring networking ...
Begin: Preconfiguring networking ... + IFFILE=/root/etc/network/interfaces
+ [ -L /root/etc/resolv.conf ]
+ DNSFILE=/root/etc/resolv.conf
+ [  = frommedia ]
+ cat
+ udevadm trigger
calling: trigger
+ udevadm settle
calling: settle
+ [ -z  ]
+ [ -n  ]
+ [ -z  ]
+ method=dhcp
+ [ dhcp != dhcp ]
+ [ ! -x /root/usr/sbin/NetworkManager ]
+ [ ! -x /root/usr/sbin/wicd ]
+ [ ! -z  ]
+ [ ! -f /root/etc/resolv.conf ]
+ cat /root/etc/resolv.conf
+ [ -z nameserver 192.168.1.1 ]
+ log_end_msg
+ _log_msg done.\n
+ [ n = y ]
+ printf done.\n
done.
+ Swap
+ LIVE_SWAP=true
+ LIVE_SWAP_DEVICES=/dev/sd* /dev/vd*
+ sed -e s|,| |g
+ echo /dev/sda /dev/sda1 /dev/sda2 /dev/sda3 /dev/sdb /dev/sdb1 /dev/vd*
+ [ ! -b /dev/sda ]
+ grep -q ^ID_FS_USAGE=raid
+ blkid -o udev -p /dev/sda
+ /bin/dd bs=10 count=1
+ /bin/dd if=/dev/sda bs=4086 skip=1 count=1
+ _MAGIC=F{vIÊ6V[†5
+ [ ! -b /dev/sda1 ]
+ grep -q ^ID_FS_USAGE=raid
+ blkid -o udev -p /dev/sda
+ /bin/dd bs=10 count=1
+ /bin/dd if=/dev/sda1 bs=4086 skip=1 count=1
+ _MAGIC=
+ [ ! -b /dev/sda2 ]
+ grep -q ^ID_FS_USAGE=raid
+ blkid -o udev -p /dev/sda
+ /bin/dd bs=10 count=1
+ /bin/dd if=/dev/sda2 bs=4086 skip=1 count=1
+ _MAGIC=
+ [ ! -b /dev/sda3 ]
+ grep -q ^ID_FS_USAGE=raid
+ blkid -o udev -p /dev/sda
+ /bin/dd bs=10 count=1
+ /bin/dd if=/dev/sda3 bs=4086 skip=1 count=1
+ _MAGIC=SWAPSPACE2
+ _SWAP_DEVICES= /dev/sda3
+ [ ! -b /dev/sdb ]
+ grep -q ^ID_FS_USAGE=raid
+ blkid -o udev -p /dev/sdb
+ /bin/dd bs=10 count=1
+ /bin/dd if=/dev/sdb bs=4086 skip=1 count=1
+ _MAGIC=
+ [ ! -b /dev/sdb1 ]
+ grep -q ^ID_FS_USAGE=raid
+ blkid -o udev -p /dev/sdb
+ /bin/dd bs=10 count=1
+ /bin/dd if=/dev/sdb1 bs=4086 skip=1 count=1
+ _MAGIC=
+ [ ! -b /dev/vd* ]
+ continue
+ grep -qs swap swap /root/etc/fstab
+ echo /dev/sda3 swap swap defaults 0 0
+ exec
+ exec


Testing this with md5-checked refracta8_xfce_i386-20161014_1432.iso booted with a custom rw initrd and a custom syslinux.cfg .
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Load to RAM option at Boot

Postby fsmithred » Thu Jan 26, 2017 1:49 pm

Thanks, dzz. I will add that information to the help file in refracta2usb. Others have run into this same problem, and it's good to know there's an easy way around it.

And maybe there's a hard way around it, too. I'll be looking at the live-boot scripts, especially the 9990's, and see if there's a way to do findsquash and get it to read only one filesystem.squashfs into ram. No idea what I'm doing, but maybe I'll get lucky.
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Load to RAM option at Boot

Postby dzz » Fri Jan 27, 2017 1:44 am

The hard way actually isn't so hard. It's all in 9990-toram-todisk .. (version 4.0.2-1)

Code: Select all
--- /lib/live/boot/9990-toram-todisk.sh   2014-12-10 09:37:04.000000000 +0000
+++ 9990-toram-todisk.sh   2017-01-27 01:03:14.548993035 +0000
@@ -8,10 +8,25 @@
   copytodev="${2}"
   copyto="${copyfrom}_swap"

-   if [ -z "${MODULETORAM}" ]
+#   if [ -z "${MODULETORAM}" ]
+#   then
+#      size=$(fs_size "" ${copyfrom}/ "used")
+#   else
+#      MODULETORAMFILE="${copyfrom}/${LIVE_MEDIA_PATH}/${MODULETORAM}"
+
+#      if [ -f "${MODULETORAMFILE}" ]
+#      then
+#         size=$( expr $(ls -la ${MODULETORAMFILE} | awk '{print $5}') / 1024 + 5000 )
+#      else
+#         log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
+#         return 1
+#      fi
+#   fi
+
+# PATCH (replace the previous conditional with the one below):
+
+   if [ -n "${MODULETORAM}" ]
   then
-      size=$(fs_size "" ${copyfrom}/ "used")
-   else
      MODULETORAMFILE="${copyfrom}/${LIVE_MEDIA_PATH}/${MODULETORAM}"

      if [ -f "${MODULETORAMFILE}" ]
@@ -21,8 +36,13 @@
         log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
         return 1
      fi
+   else
+      # size the squashfs, not the entire partition
+      size=$(fs_size "" ${copyfrom}/${LIVE_MEDIA_PATH}/filesystem.squashfs "used")
   fi

+
+
   if [ "${copytodev}" = "ram" ]
   then
      # copying to ram:
@@ -83,8 +103,14 @@
      else
         if [ -x /bin/rsync ]
         then
-            echo " * Copying whole medium to RAM" 1>/dev/console
-            rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
+
+#            echo " * Copying whole medium to RAM" 1>/dev/console
+#            rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
+
+### PATCH (Replace the previous 2 lines with next 2)
+            echo " * Copying squashfs to RAM" 1>/dev/console
+            rsync -a --progress ${copyfrom}/${LIVE_MEDIA_PATH}/*.squashfs ${copyto}/${LIVE_MEDIA_PATH}/ 1>/dev/console
+
         else
            mkdir -p ${copyto}/${LIVE_MEDIA_PATH}
            cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/* ${copyto}/${LIVE_MEDIA_PATH}


Changes are for /bin/boot/9990-toram-todisk and /lib/live/boot/9990-toram-todisk of the initrd. Works here, booting from squashfs with toram. Only /refracta8/filesystem.squashfs is in /lib/live/mount/medium/ ..The usb is not mounted and can be pulled out.
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred