M BUZZ CRAZE NEWS
// news

How to create a persistent live on a file (disk image)?

By John Parsons

I created a personnalized ubuntustudio iso with cubic (it is smaller than the official).

And i would like to write a persistent live in a file less than 4G (audio-ubuntustudio.img)

In order to be able to clone the disk image to USB keys using dd or rufus.exe even if they are greater than 4GB.

I've tried with mkusb but it doesn't want to write to disk image.

Do you know an mkusb option or another tool to do that ?

6

1 Answer

Install virtualbox:

sudo apt install virtualbox

Start by creating a file of the desired size:

fallocate -l 3900M my-virtual-usb-stick.img

start virtualbox:

sudo virtualbox

Create a virtual machine with a virtual disk on which you will install Linux and mkusb using the graphical interface. Or start an iso image with mkusb built-in.

Attach (with virtualbox GUI) to that virtual machine a usb storage disk my-virtual-usb-stick.vmdk created with the following command in a terminal (CTRL+ALT+t):

sudo VBoxManage internalcommands createrawvmdk \ -filename ./my-virtual-usb-stick.vmdk \ -rawdisk ./my-virtual-usb-stick.img

then Start the virtual machine, download the Linux iso file and use mkusb with the virtual usb drive.

Once done, stop the virtual machine and quit virtualbox.

Then you can dd your image to a real usb stick (Replace the X with your drive letter):

dd if=./my-virtual-usb-stick.img of=/dev/sdX bs=4M status=progress

Reboot with your usb stick, and it works !

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy