Author Topic: LiveUSB/LiveHDD Shutdown Error  (Read 4755 times)

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #15 on: April 28, 2011, 07:08:27 AM »
Hi _steve,

where did you found info about this flags ?
Quote
root=/dev/rd/3

THX,

AS

Is that not the standard ram disk boot code for a liveCD?

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #16 on: April 28, 2011, 07:14:08 AM »
Hi _steve,

where did you found info about this flags ?
Quote
root=/dev/rd/3

THX,

AS

Is that not the standard ram disk boot code for a liveCD?

yes, but I'm looking for docs ...

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #17 on: April 28, 2011, 07:15:02 AM »
Hi _steve,

where did you found info about this flags ?
Quote
root=/dev/rd/3

THX,

AS

Is that not the standard ram disk boot code for a liveCD?

yes, but I'm looking for docs ...


Sorry ......  misunderstood  :(

smcs_steve

  • Guest
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #18 on: April 28, 2011, 05:30:06 PM »
Just19,
I don't think I have the same issue with unmounting here as I run my PCLOS liveUSB stick as an isohybrid partition with a separate partition for the changes stuff.   :)
I do however have some limitations with data file size due to RAM limits (large torrents and copying large video files etc)
>Steve


You won't, as I won't when 'burning' an image to a drive or partition or CD or DVD .....  they are not RW media in that form.
The changes partition though should be worth looking at ........  as that might exhibit some incorrect shutdowns .....  but I do not know this as I have not used an ISO built for persistence and hybrid, since I tested the idea some time back.

It would be interesting to see the results of a fsck on the changes partition after some changes are made, the OS shut down, the device unplugged and then tested from another OS.

Have you been checking that partition?

That might give some indication.

regards.

Likely!  I'll take a look later and report back results.  :)
>Steve

smcs_steve

  • Guest
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #19 on: April 28, 2011, 05:34:28 PM »
Results of fsck on changes partition>

Code: [Select]
[root@localhost ~]# fsck /dev/sdb2
fsck from util-linux-ng 2.16.2
e2fsck 1.41.12 (17-May-2010)
MyData_ was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 106511 has zero dtime.  Fix<y>? yes

Deleted inode 106726 has zero dtime.  Fix<y>? yes

Deleted inode 106890 has zero dtime.  Fix<y>? yes

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -442368 -442379
Fix<y>? yes

Free blocks count wrong for group #13 (16331, counted=16333).
Fix<y>? yes

Free blocks count wrong (1502041, counted=1502043).
Fix<y>? yes

Inode bitmap differences:  -106511 -106726 -106890
Fix<y>? yes

Free inodes count wrong for group #13 (7785, counted=7788).
Fix<y>? yes

Free inodes count wrong (392511, counted=392514).
Fix<y>? yes
                                                                                                                                            
                                                                                                                                            
MyData_: ***** FILE SYSTEM WAS MODIFIED *****                                                                                              
MyData_: 702/393216 files (7.4% non-contiguous), 70318/1572361 blocks                                                                      
[root@localhost ~]#  

Well - nothing much wrong there !!   ;D ;D  ;)

edit>  and after another session fsck still reports MyData_ was not cleanly unmounted, check forced. etc etc.. >:(
« Last Edit: April 30, 2011, 02:05:10 AM by _steve »

smcs_steve

  • Guest
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #20 on: April 28, 2011, 06:22:37 PM »
Talking out loud (to myself?)...
I might try using FAT32 for the changes partition later and changes_dev=Label=MyData_  ... ???
>Steve

Hmmm..  MyData_ has to be a Linux partition...  ???
« Last Edit: April 28, 2011, 06:43:34 PM by _steve »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #21 on: April 29, 2011, 12:50:26 AM »
Talking out loud (to myself?)...
I might try using FAT32 for the changes partition later and changes_dev=Label=MyData_  ... ???
>Steve

Hmmm..  MyData_ has to be a Linux partition...  ???

'changes' cannot be on a VFAT partition .....  I think it may even be limited to ext, but I have never tried any other.
Permissions of the files in changes must be preserved to integrate them into the booting OS; this cannot be done on a VFAT partition.

***

The results of your fsck are as I expected.

This needs to be looked into.

regards.

smcs_steve

  • Guest
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #22 on: April 29, 2011, 02:08:44 AM »
I've been reading here>  http://www.ibm.com/developerworks/linux/library/l-boot.html#listing2  for background info...
and also in >  /etc/rc.d/init.d/halt
Quote
# halt          This file is executed by init when it goes into runlevel
#               0 (halt) or runlevel 6 (reboot). It kills all processes,
#               unmounts file systems and then either halts or reboots.



« Last Edit: April 29, 2011, 11:24:39 PM by _steve »

smcs_steve

  • Guest
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #23 on: April 29, 2011, 11:37:42 PM »
Ahhh!....  /usr/share/mylivecd/halt.local  already mentioned! ::)

My liveUSB session /proc/mounts reads>
Quote
rootfs / rootfs rw 0 0
/dev/root.old /initrd ext2 rw,relatime,errors=continue 0 0
none /initrd/proc proc rw,relatime 0 0
none /initrd/sys sysfs rw,relatime 0 0
/dev/shm / tmpfs rw,relatime,size=497544k,nr_inodes=128031 0 0
none /dev tmpfs rw,relatime,size=512124k,nr_inodes=128031 0 0
/dev/sdb1 /initrd/cdrom iso9660 ro,relatime 0 0
/dev/loop0 /initrd/loopfs squashfs ro,relatime 0 0
/dev/sdb2 /initrd/changes ext2 rw,relatime,errors=continue 0 0
unionfs /union unionfs rw,relatime,dirs=/initrd/changes/changes/livecd=rw:/initrd/loopfs=ro 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
none /dev/pts devpts rw,relatime,mode=620,ptmxmode=000 0 0
none /dev/shm tmpfs rw,relatime,size=512124k,nr_inodes=128031 0 0
none /proc/bus/usb usbfs rw,relatime,devgid=43,devmode=664 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
/dev/sdc1 /media/Tos16G ext2 rw,nosuid,nodev,relatime,errors=continue 0 0

in /usr/share/mylivecd/halt.local
this bit>
Quote
#system("mount -t proc none /proc");
my ($device) = cat_("/proc/mounts") =~ m!(/dev/\S+)\s+/initrd/cdrom\s+iso9660!;
system("umount /proc");
$device or exit;

needs to be expanded to include>  /dev/sdbX /initrd/changes    yes?

How do I do that?
>Steve

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #24 on: April 30, 2011, 03:39:00 AM »
Ahhh!....  /usr/share/mylivecd/halt.local  already mentioned! ::)

My liveUSB session /proc/mounts reads>
Quote
rootfs / rootfs rw 0 0
/dev/root.old /initrd ext2 rw,relatime,errors=continue 0 0
none /initrd/proc proc rw,relatime 0 0
none /initrd/sys sysfs rw,relatime 0 0
/dev/shm / tmpfs rw,relatime,size=497544k,nr_inodes=128031 0 0
none /dev tmpfs rw,relatime,size=512124k,nr_inodes=128031 0 0
/dev/sdb1 /initrd/cdrom iso9660 ro,relatime 0 0
/dev/loop0 /initrd/loopfs squashfs ro,relatime 0 0
/dev/sdb2 /initrd/changes ext2 rw,relatime,errors=continue 0 0
unionfs /union unionfs rw,relatime,dirs=/initrd/changes/changes/livecd=rw:/initrd/loopfs=ro 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
none /dev/pts devpts rw,relatime,mode=620,ptmxmode=000 0 0
none /dev/shm tmpfs rw,relatime,size=512124k,nr_inodes=128031 0 0
none /proc/bus/usb usbfs rw,relatime,devgid=43,devmode=664 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
/dev/sdc1 /media/Tos16G ext2 rw,nosuid,nodev,relatime,errors=continue 0 0


I think the the un mounting here is a bit more complex:
you can see from your /proc/mounts that there is a unionfs built up from /initrd/changes and /initrd/loopfs, and because you can't umount a filesystem while in use, as first step there is the need to umount /union.

Unfortunately this introduce other problems, because /union is (while liveUSB is running) the / filesystem.

AS

smcs_steve

  • Guest
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #25 on: April 30, 2011, 04:26:47 AM »
AS,
Could we -- copy to & then remap the changes partition to a RAM-drive and then unmount the USB partition?
(I'm not doing a boot to RAM here, just the changes at shutdown)
>Steve

« Last Edit: April 30, 2011, 05:56:11 AM by _steve »

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #26 on: April 30, 2011, 08:27:54 AM »
AS,
Could we -- copy to & then remap the changes partition to a RAM-drive and then unmount the USB partition?
(I'm not doing a boot to RAM here, just the changes at shutdown)
>Steve


Not sure to completely understand what you mean, not used to isohybrid, but copying the "changes" to "ram" should result in a fault by design, because in a liveUSB "changes partition" you could have much more data then the available RAM.  :o

AS

smcs_steve

  • Guest
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #27 on: April 30, 2011, 10:08:41 PM »
deleted by _steve
« Last Edit: May 02, 2011, 01:52:02 AM by _steve »

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #28 on: May 01, 2011, 03:33:32 AM »
As a first step, I'm trying to umount the /union fs, until now failed ...
shutdown is performed by /etc/init and in turn by /etc/rc0.d/halt, both files actually resides on "/ = /union" fs,
the result is that /union is "busy" when you try to unmount it... I think I need to learn better how unionfs, (may be aufs too), actually works.

AS

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: LiveUSB/LiveHDD Shutdown Error
« Reply #29 on: May 01, 2011, 04:50:41 AM »
seems it can be done with aufs .....  but am failing to find anything about repeatable success with union fs  :D