Image creation [Solved]

Ask questions about Arch Linux ARM. Please search before making a new topic.

Image creation [Solved]

Postby MrGreen » Fri Feb 28, 2014 11:36 am

Am really sorry if this has been answered before but I am looking for information on creating filesystem images. A start would be how to mount <foo>.img files so I can take a look at them. Need to also figure out how to create <foo>.img as I am interested in trying a new approach to iso files (for usb devices)
Last edited by MrGreen on Fri Feb 28, 2014 12:49 pm, edited 1 time in total.
MrGreen
 
Posts: 54
Joined: Sun Dec 25, 2011 12:55 pm

Re: Image creation

Postby moonman » Fri Feb 28, 2014 11:46 am

dd or iso image? iso is for optical media.

https://wiki.archlinux.org/index.php/Fi ... isk_images

If you really want to mount iso:
http://www.cyberciti.biz/tips/how-to-mo ... linux.html

I googled all that in less than 30 sec
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Image creation

Postby MrGreen » Fri Feb 28, 2014 12:04 pm

Not iso I can do that, its the .img file creation I am interested in.

Basically want to reduce filesystem into an img file I can zip up, seen some image files of around 150mb that expand to over 1.5Gb
MrGreen
 
Posts: 54
Joined: Sun Dec 25, 2011 12:55 pm

Re: Image creation

Postby pepedog » Fri Feb 28, 2014 12:13 pm

You can dd a blank file (as in first stage of creating a swap file.
You can fdisk that file
Build and install multipath-tools-git from the aur
It could then be as simple as
$this->bbcode_second_pass_code('', 'kpartx -av image-filename.img
sleep 5
mkfs.ext4 /dev/mapper/loop0p1
mkdir /mnt/1
mount /dev/mapper/loop0p1 /mnt/1')
When you have finished unmounting, then
$this->bbcode_second_pass_code('', 'kpartx -d image-filename.img')
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Image creation

Postby MrGreen » Fri Feb 28, 2014 12:49 pm

That is more what I need, thank you very much
MrGreen
 
Posts: 54
Joined: Sun Dec 25, 2011 12:55 pm

Re: Image creation [Solved]

Postby MrGreen » Sat Mar 01, 2014 9:07 am

This is what I was interested in reducing a filesystem image to a small download

This is what brought it to my attention

$this->bbcode_second_pass_code('', 'rw-r--r-- 1 mrgreen users 192M Feb 28 22:00 ArchLinuxARM-rpi-latest.zip
')
Expands too

$this->bbcode_second_pass_code('', '-rw-r--r-- 1 mrgreen users 1.9G Feb 2 00:02 ArchLinuxARM-2014.02-rpi.img')

My thinking is I could upload smaller iso images (for usb devices) which would reduce upload/download times, possibly allow me to ship with more applications
MrGreen
 
Posts: 54
Joined: Sun Dec 25, 2011 12:55 pm

Re: Image creation [Solved]

Postby pepedog » Sat Mar 01, 2014 9:19 am

Remember the part at the start where dd creates image with /dev/zero? It plays a part in compression.
So after cleanup of logs/files/cache fill spare space with zero, then delete it, eg
dd if=/dev/zero of=/pathtomount/fillfile bs=1M
rm/pathtomount/fillfile
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Image creation [Solved]

Postby MrGreen » Sat Mar 01, 2014 9:28 am

To save space on iso I had to remove locales and man pages, not the best of ideas. Packages wise other than removing gtk3 we are down to the bone. Still running at around 500mb.

Wanted to find a different route, as many users dd onto a usb device/drive. Shipping an image and simply installing setting up bootloader (which is no big deal). Another advantage is that system is capable of being fully updated, an iso image is limited even with persistence.

Am reading up on creating arch linux images in Arch wiki so have some work to do yet.

Thank you for taking the time to point me in the right direction

MrG
MrGreen
 
Posts: 54
Joined: Sun Dec 25, 2011 12:55 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 10 guests