Wednesday 11 December 2013

/dev/loopN on fedora

for some reason loop module is not compiled in and systemd doesn't create nodes for loop devices.
if you need to mount/dump some partition on some image, let say on dump of mmcblk0 from embedded device, there is a way to do it:


  • create loop device (must be repeated before any additional file processed by kpartx):

'losetup -f'

  • create "looped" partitions

'kpartx -av some_dump_file'

  • now you can do whatever you want on disk image and partitions like:

'sgdisk -p /dev/loopN'or
'dd if=/dev/mapper/loopNpNN of=dump_of_partition'

  • when finished remove maps:

'kpartx -dv some_dump_file'


Friday 15 November 2013

scp - ssh = brackets

i tried figure out how to transfer file from from laptop to ifc6410 board hooked to laptop via utp cable. using tcpdump i identified ipv6 address of ifc6410 board and connected using ssh.

connecting to remote machine is easy:

'ssh username@ipv6::ugly:addr:esss%ethN'

for scp that's not enough. scp needs brackets:

'scp filename username@[ipv6::ugly:addr:esss%ethN]:'

Sunday 20 October 2013

multiple tty opened in one screen session

while i was playing with 'console' as serial line i/o, i found nice feature:
'ctrl-a :' and typing 'screen /dev/ttyUSB0 115200' and then 'ctrl-a :' and typing 'screen /dev/ttyACM0 115200' i got 2 serial devices attached.
using 'ctrl-a "' i listed all screens:
###########
Num Name                                                                                                                                                   Flags

  0 ttyUSB0
  1 ttyACM0                                                                                                                                                  
###########