Moving file system to NVME procedure?


#1

From what I understand I will still have to have the bootloader and kernel on an EMMC or uSD
So what’s the correct way to move the filesystem to an NVME? Is there a builtin script for this? Update grub?
I was hoping to just change a mount point in fstab but root is not even mounted from fstab.

Thanks


Capable of booting off USB or M.2 in the future?
TUN/TAP - tun module and openvpn failure
#2

First, make a partition on nvme device with fdisk or parted, the partition will be under /dev/nvme0n1p1. Then, move your rootfs from sd/emmc to nvme with dd

dd if=/dev/disk/by-partuuid/b921b045-1df0-41c3-af44-4c6f280d3fae   \
 conv=sync,noerror bs=4M of=/dev/nvme0n1p1

Extend the filesystem

resize2fs /dev/nvme0n1p1

Edit /boot/extlinux/extlinux.conf

change

root=PARTUUID=b921b045-1d

to

root=/dev/nvme0n1p1

reboot and check mount.


#3

Thanks Jack

Installed and running well


#4

Hi Jack, I can’t find /boot/extlinux/extlinux.conf on the Debian installation (/boot is empty) and fstab is also doesn’t contain ‘/’, any ideas ?
Thanks


#5

You can install package rockchip-fstab, it will create the /boot mount point.


#6

Hi Jack, thanks for your help, I’m up and running now, I’ve included your details of how to setup the radxa repository, so that others can find the package more easily.

wget -O - http://apt.radxa.com/stretch/public.key | sudo apt-key add -

create /etc/apt/sources.list.d/apt-radxa-com.list and add

deb http://apt.radxa.com/stretch/ stretch main

and run

apt-get update
apt-get install rockchip-fstab

#7

Hi,

@jack, thank you for help.

  Model B 4GB
  Samsung SSD 970 EVO NVMe M.2 (MZ-V7E500BW)
  Operating System: Ubuntu 18.04.2 LTS
            Kernel: Linux 4.4.154-59-rockchip-g5e70f14

After first boot:
4,5% full boot_nr_1
df -H

Filesystem Size Used Avail Use% Mounted on
/dev/root 12G -227G 239G - /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 1.2M 2.0G 1% /run
tmpfs 5.3M 4.1k 5.3M 1% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mmcblk0p4 105M 40M 65M 38% /boot
/dev/sda2 5.0T 4.4T 337G 93% /media/rock/my
/dev/sdb1 3.0T 2.5T 309G 89% /media/rock/backup
tmpfs 400M 0 400M 0% /run/user/0
tmpfs 400M 25k 400M 1% /run/user/1000
/dev/mmcblk0p5 16G 5.9G 9.0G 40% /media/rock/ubt-bionic

After second boot:
96.3% full !!!boot_nr_2
df -H

Filesystem Size Used Avail Use% Mounted on
/dev/root 16G 6.2G 8.7G 42% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 98M 2.0G 5% /dev/shm
tmpfs 2.0G 1.2M 2.0G 1% /run
tmpfs 5.3M 4.1k 5.3M 1% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mmcblk0p4 105M 40M 65M 38% /boot
/dev/sda2 5.0T 4.4T 337G 93% /media/rock/my
/dev/sdb1 3.0T 2.5T 309G 89% /media/rock/backup
tmpfs 400M 0 400M 0% /run/user/0
tmpfs 400M 41k 400M 1% /run/user/1000
/dev/mmcblk0p5 16G 5.9G 9.0G 40% /media/rock/ubt-bionic

blkid

/dev/nvme0n1p1: LABEL=“ubt-bionic” UUID=“9d4f00d3-3731-4dac-a791-7dbd9cb156e2” TYPE=“ext4” PARTUUID=“11632fb8-01”
/dev/mmcblk0p4: SEC_TYPE=“msdos” LABEL=“boot” UUID="(…)" TYPE=“vfat” PARTLABEL=“boot” PARTUUID="(…)"
/dev/mmcblk0p5: LABEL=“ubt-bionic” UUID="(…)" TYPE=“ext4” PARTLABEL=“rootfs” PARTUUID="(…)"
/dev/sda2: LABEL=“my” (…)
/dev/sdb1: LABEL=“backup” (…)

… something is wrong e.g: when I try to save a file ~ 20GB to the desktop:
There is 8.7 GB available, but 20.0 GB is required, write speed ~30MB/s.

any ideas ? :slight_smile:


#8

when the rootfs is full, what cat /proc/cmdline shows? It seems the rootfs fall back to emmc.


#9

@jack, cat /proc/cmdline:

earlyprintk console=ttyFIQ0,1500000n8 rw init=/sbin/init root=/dev/nvme0n1p1 rootwait rootfstype=ext4

I don’t have emmc, Micro SD Card only.


#10

How many partitions are there on your SSD? If nvme0n1p1 is your only partition, I’d suggest to try resize2fs /dev/nvme0n1p1 to grow the file system