Ed_P wrote:brokenman wrote:If you are checking all conditions, don't forget the scenario where one boots via iso and uses copy2ram.
If one boots via an iso isn't the iso in ram so why would one need to use copy2ram?
brokenman wrote:They wouldn't. But if they did you would find a different set of circumstances in /mnt/live/ which have to be taken into account when scripting.
Ed_P wrote:If one boots via an iso isn't the iso in ram
This was somewhat worrying, as the thought arose that had been using
copy2ram to no purpose.
If I read it correctly, there are only two places where copy2ram is referenced:
- Before copying modules to RAM
- Before checking for removable booting medium
So it seems the only way one can receive a message that booting media are safely removable, is by using copy2ram.
To be doubly sure that copy2ram is not irrelevant when booting via an iso, had a bit of fun doctoring an initrd to provide relevant diagnostic output:
- copy2ram
- Upon entry to Live System
Code: Select all
guest@porteus:~$ free -m
total used free shared buff/cache available
Mem: 879 318 78 248 482 150
Swap: 644 32 612
Code: Select all
quiet debug from=/dev/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso copy2ram ramsize=30% noauto rootcopy=/dev/sda4/cin_rcp
- Prior to Live System entry
Code: Select all
Live System ready. About to Pivot Root:
free -m
total used free shared buffers
Mem: 879 281 598 260 1
-/+ buffers: 280 599
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 266472
-rw-r--r-- 1 42.8M 000-kernel.xzm
-rw-r--r-- 1 65.6M 001-core.xzm
-rw-r--r-- 1 78.3M 002-xorg.xzm
-rw-r--r-- 1 73.5M 003-cinnamon.xzm
losetup
/dev/loop1: 0 /memory/copy2ram/000-kernel.xzm
/dev/loop2: 0 /memory/copy2ram/001-core.xzm
/dev/loop3: 0 /memory/copy2ram/002-xorg.xzm
/dev/loop4: 0 /memory/copy2ram/003-cinnamon.xzm
mount
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop)
- At the End of the Day (Shutdown):
Code: Select all
free -m
total used free shared buffers
Mem: 879 293 586 275 0
-/+ buffers: 280 599
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 2 40 000-kernel.xzm
drwxr-xr-x 2 40 001-core.xzm
drwxr-xr-x 2 40 002-xorg.xzm
drwxr-xr-x 2 40 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 266472
-rw-r--r-- 1 42.8M 000-kernel.xzm
-rw-r--r-- 1 65.6M 001-core.xzm
-rw-r--r-- 1 78.3M 002-xorg.xzm
-rw-r--r-- 1 73.5M 003-cinnamon.xzm
losetup
mount
- [copy2ram]
- Upon entry to Live System
Code: Select all
guest@porteus:~$ free -m
total used free shared buff/cache available
Mem: 879 352 78 25 448 337
Swap: 517 0 516
Code: Select all
quiet debug from=/dev/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso ramsize=30% noauto rootcopy=/dev/sda4/cin_rcp
- Prior to Live System entry
Code: Select all
Live System ready. About to Pivot Root:
free -m
total used free shared buffers
Mem: 879 28 851 0 2
-/+ buffers: 26 853
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 0
losetup
/dev/loop0: 0 /mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
/dev/loop1: 0 /mnt/isoloop/porteus/base/000-kernel.xzm
/dev/loop2: 0 /mnt/isoloop/porteus/base/001-core.xzm
/dev/loop3: 0 /mnt/isoloop/porteus/base/002-xorg.xzm
/dev/loop4: 0 /mnt/isoloop/porteus/base/003-cinnamon.xzm
mount
/dev/loop0 on /mnt/isoloop type iso9660 (loop,ro)
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop,ro)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop,ro)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop,ro)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop,ro)
- At the End of the Day (Shutdown):
Code: Select all
free -m
total used free shared buffers
Mem: 879 126 752 15 11
-/+ buffers: 115 764
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 2 40 000-kernel.xzm
drwxr-xr-x 2 40 001-core.xzm
drwxr-xr-x 2 40 002-xorg.xzm
drwxr-xr-x 2 40 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 0
losetup
mount
Comparing memory usage clearly shows a difference when using
copy2ram in the case of bootiing from ISO file. So far noticed no deterioration in performance when not running in RAM, but just from ISO. The bad news is that system is looping at two remove. Firstly on the ISO file, then at two remove on kernel, core, xorg, and cinnamon. So have disk accesses to loop ISO then additional accesses to loop the system modules. The good news however being that some 260M, of limited 879M RAM in total, becomes available. Maybe it's a matter of what you lose on the roundabouts, you gain on the swings.
porteus-livedbg- copy2ram
Code: Select all
quiet debug from=/dev/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso copy2ram ramsize=30% noauto rootcopy=/dev/sda4/cin_rcp
Prior to copying of rootcopy folder
free -m
total used free shared buffers
Mem: 879 804 75 262 1
-/+ buffers: 802 76
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 266472
-rw-r--r-- 1 42.8M 000-kernel.xzm
-rw-r--r-- 1 65.6M 001-core.xzm
-rw-r--r-- 1 78.3M 002-xorg.xzm
-rw-r--r-- 1 73.5M 003-cinnamon.xzm
losetup
/dev/loop0: 0 /mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
/dev/loop1: 0 /memory/copy2ram/000-kernel.xzm
/dev/loop2: 0 /memory/copy2ram/001-core.xzm
/dev/loop3: 0 /memory/copy2ram/002-xorg.xzm
/dev/loop4: 0 /memory/copy2ram/003-cinnamon.xzm
mount
/dev/loop0 on /mnt/isoloop type iso9660 (loop,ro)
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop)
After renewed Setup of File System Table and Before checking for copy into ram of removable media
free -m
total used free shared buffers
Mem: 879 807 72 262 3
-/+ buffers: 804 75
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 266472
-rw-r--r-- 1 42.8M 000-kernel.xzm
-rw-r--r-- 1 65.6M 001-core.xzm
-rw-r--r-- 1 78.3M 002-xorg.xzm
-rw-r--r-- 1 73.5M 003-cinnamon.xzm
losetup
/dev/loop0: 0 /mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
/dev/loop1: 0 /memory/copy2ram/000-kernel.xzm
/dev/loop2: 0 /memory/copy2ram/001-core.xzm
/dev/loop3: 0 /memory/copy2ram/002-xorg.xzm
/dev/loop4: 0 /memory/copy2ram/003-cinnamon.xzm
mount
/dev/loop0 on /mnt/isoloop type iso9660 (loop,ro)
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop)
# Recognized devices:
...
/dev/sda11: UUID="6a0167f6-5cf7-412d-b85f-0076ca590371" TYPE="swap"
# Booting device:
/mnt/isoloop
# Porteus data found in:
/mnt/isoloop/porteus
# Changes are stored in:
memory
# Non standard /rootcopy dir:
/dev/sda4/cin_rcp
# Modules activated during boot time:
/memory/copy2ram/000-kernel.xzm
/memory/copy2ram/001-core.xzm
/memory/copy2ram/002-xorg.xzm
/memory/copy2ram/003-cinnamon.xzm
ISO=/mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
Live System ready. About to Pivot Root:
free -m
total used free shared buffers
Mem: 879 281 598 260 1
-/+ buffers: 280 599
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 266472
-rw-r--r-- 1 42.8M 000-kernel.xzm
-rw-r--r-- 1 65.6M 001-core.xzm
-rw-r--r-- 1 78.3M 002-xorg.xzm
-rw-r--r-- 1 73.5M 003-cinnamon.xzm
losetup
/dev/loop1: 0 /memory/copy2ram/000-kernel.xzm
/dev/loop2: 0 /memory/copy2ram/001-core.xzm
/dev/loop3: 0 /memory/copy2ram/002-xorg.xzm
/dev/loop4: 0 /memory/copy2ram/003-cinnamon.xzm
mount
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop)
- [copy2ram]
Code: Select all
quiet debug from=/dev/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso ramsize=30% noauto rootcopy=/dev/sda4/cin_rcp
Prior to copying of rootcopy folder
free -m
total used free shared buffers
Mem: 879 23 856 1 1
-/+ buffers: 22 857
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 0
losetup
/dev/loop0: 0 /mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
/dev/loop1: 0 /mnt/isoloop/porteus/base/000-kernel.xzm
/dev/loop2: 0 /mnt/isoloop/porteus/base/001-core.xzm
/dev/loop3: 0 /mnt/isoloop/porteus/base/002-xorg.xzm
/dev/loop4: 0 /mnt/isoloop/porteus/base/003-cinnamon.xzm
mount
/dev/loop0 on /mnt/isoloop type iso9660 (loop,ro)
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop,ro)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop,ro)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop,ro)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop,ro)
After renewed Setup of File System Table and Before checking for copy into ram of removable media
free -m
total used free shared buffers
Mem: 879 31 847 2 2
-/+ buffers: 29 850
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 0
losetup
/dev/loop0: 0 /mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
/dev/loop1: 0 /mnt/isoloop/porteus/base/000-kernel.xzm
/dev/loop2: 0 /mnt/isoloop/porteus/base/001-core.xzm
/dev/loop3: 0 /mnt/isoloop/porteus/base/002-xorg.xzm
/dev/loop4: 0 /mnt/isoloop/porteus/base/003-cinnamon.xzm
mount
/dev/loop0 on /mnt/isoloop type iso9660 (loop,ro)
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop,ro)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop,ro)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop,ro)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop,ro)
# Recognized devices:
...
/dev/sda11: UUID="6a0167f6-5cf7-412d-b85f-0076ca590371" TYPE="swap"
# Booting device:
/mnt/isoloop
# Porteus data found in:
/mnt/isoloop/porteus
# Changes are stored in:
memory
# Non standard /rootcopy dir:
/dev/sda4/cin_rcp
# Modules activated during boot time:
/mnt/isoloop/porteus/base/000-kernel.xzm
/mnt/isoloop/porteus/base/001-core.xzm
/mnt/isoloop/porteus/base/002-xorg.xzm
/mnt/isoloop/porteus/base/003-cinnamon.xzm
ISO=/mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
Live System ready. About to Pivot Root:
free -m
total used free shared buffers
Mem: 879 28 851 0 2
-/+ buffers: 26 853
Swap: 0 0 0
ls -lh /memory/images
total 0
drwxr-xr-x 7 83 000-kernel.xzm
drwxr-xr-x 19 268 001-core.xzm
drwxr-xr-x 9 130 002-xorg.xzm
drwxr-xr-x 11 141 003-cinnamon.xzm
ls -lh /memory/copy2ram
total 0
losetup
/dev/loop0: 0 /mnt/sda10/tmp/iso/v3.2/i586/Porteus-CINNAMON-v3.2rc5-i586.iso
/dev/loop1: 0 /mnt/isoloop/porteus/base/000-kernel.xzm
/dev/loop2: 0 /mnt/isoloop/porteus/base/001-core.xzm
/dev/loop3: 0 /mnt/isoloop/porteus/base/002-xorg.xzm
/dev/loop4: 0 /mnt/isoloop/porteus/base/003-cinnamon.xzm
mount
/dev/loop0 on /mnt/isoloop type iso9660 (loop,ro)
aufs on /union type aufs (nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw)
/dev/loop1 on /memory/images/000-kernel.xzm type squashfs (loop,ro)
/dev/loop2 on /memory/images/001-core.xzm type squashfs (loop,ro)
/dev/loop3 on /memory/images/002-xorg.xzm type squashfs (loop,ro)
/dev/loop4 on /memory/images/003-cinnamon.xzm type squashfs (loop,ro)
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB