Skip to content

2.1 Filesystem: share files and resize rootfs

nongiach edited this page Jun 16, 2018 · 2 revisions

The current directory can be shared with the guest

When the --sync option is specified the current directory is uploaded inside the VM home directory. Once inside the VM, you have to type the command save before exiting if you want to sync back. If you have a lot of files you might need to arm_now resize.

$ ls
a_file_created_on_the_host
$ arm_now start armv5-eabi --sync
Welcome to Buildroot
buildroot login: root
# ls
a_file_created_on_the_host
# touch a_file_create_on_the_guest
# ls
a_file_created_on_the_host a_file_create_on_the_guest
# save
# poweroff
( back to host, you can also ctrl+] to kill qemu )
# ls
a_file_created_on_the_host a_file_create_on_the_guest

Resize the filesystem

$ arm_now resize 200M
WARNING: Image format was not specified for 'arm_now/rootfs.ext2' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Image resized.
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
arm_now/rootfs.ext2: 912/24960 files (5.3% non-contiguous), 26264/102400 blocks
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on arm_now/rootfs.ext2 to 204800 (1k) blocks.
The filesystem on arm_now/rootfs.ext2 is now 204800 (1k) blocks long.

-rw-r--r-- 1 tutu users 200M Jun  5 00:21 arm_now/rootfs.ext2
[+] Resized to 200M

Show informations about the current filesystem

$ arm_now show
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Info ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch         = armv5-eabi
rootfs size  = 200M
~~~~~~~~~~~~~~~~~~~~~~~~ e2ls arm_now/rootfs.ext2:/root ~~~~~~~~~~~~~~~~~~~~~~~~
a_directory_in_root_home  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~