# \[Tutorial - Outdated\] Odroid: - Move the filesystem to a USB Drive

**URL:** <https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328>\
**Category:** Community Tutorials\
**Created:** [2 May 2016 23:31 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328 "2016-05-02T23:31:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![dyteso](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@dyteso](https://dietpi.com/forum/u/dyteso)\
**Post date:** [2 May 2016 23:31 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/1 "2016-05-02T23:31:43Z")

</div>

Hi

Does anyone know how to move the filesystem to a USB Drive.  
I’m working with ODroid-XU4 with Dietpi OS that is being display at [http://odroid.com/dokuwiki/doku.php?id=en:odroid-xu4](http://odroid.com/dokuwiki/doku.php?id=en:odroid-xu4).  
I saw couple of post here , one for raspberry pi, which does not work for Dietpi, I was not able to find /boot/cmdline.txt file. And another one that speed up USB device

I was able to do this on Raspberry Pi 2, but would like to try with Odroid-XU4 and USB SDD drive. I really want to speedup my read/write time.

Hope someone could help me with this task  
Thanks  
Jorge

---

<div class="post-metadata">

**Author:** ![k-plan](https://dietpi.com/forum/user_avatar/dietpi.com/k-plan/32/12_2.png) [@k-plan](https://dietpi.com/forum/u/k-plan)\
**Post date:** [5 May 2016 14:59 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/2 "2016-05-05T14:59:50Z")

</div>

Hi Jorge,

do not own a Odroid-XU4, but make a guide for all DietPi supported ODROID device.  
You can give it a try and let us know, if it will work for you.

cu  
k-plan  
.

---

<div class="post-metadata">

**Author:** ![k-plan](https://dietpi.com/forum/user_avatar/dietpi.com/k-plan/32/12_2.png) [@k-plan](https://dietpi.com/forum/u/k-plan)\
**Post date:** [5 May 2016 15:16 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/3 "2016-05-05T15:16:36Z")

</div>

Hi,

_edit by k-plan:_

**_This Tutorial is outdated!  
You can now use [DietPi-Drive Manager](https://dietpi.com/phpbb/viewtopic.php?f=8&t=673).  
It’s more simple and do all the steps for you with more options._**

**_System:_**  
DietPi V117 | ODROID-C1+ (_e.g. in my case a fresh installation_)  
_Micro SD-Card:_ - Verbatim 8GB Class 10 Micro SDHC  
_USB Device:_ - SanDisk Ultra Fit 64GB USB 3.0 drive  
_Boot up time: -_ ca. 25 sec

**_Note:_**

- should work on Hardkernel ODROID devices like: C0, C1, C1+, C2 (tested) and XU4, XU3 (tested by user)  
_Why to use this “ **extended version** ”?  
Because it’s possible to use more than only one drive attached to your device._  
  
  
**# Preparation**

- Install some tools we’ll need later:

```nohighlight
root@oDroid-C1-TEST:~# apt-get install rsync

```

- Insert USB drive and check to see if usb is recognized:

```nohighlight
rroot@oDroid-C1-TEST:~# lsusb
Bus 001 Device 003: ID 0781:5583 SanDisk Corp.
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

```

- Locate the USB device name ( _/dev/sdx_ ):

```nohighlight
root@oDroid-C1-TEST:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 57.9G 0 disk
└─sda1 8:1 1 57.9G 0 part
mmcblk0 179:0 0 7.4G 0 disk
├─mmcblk0p1 179:1 0 128.5M 0 part /boot
└─mmcblk0p2 179:2 0 7.3G 0 part /

```

In this example, USB device is on sda. From this point on we use /dev/sda for the USB drive.  
  
\

- Formatting the USB drive:

```nohighlight
root@oDroid-C1-TEST:~# /DietPi/dietpi/dietpi-external_drive_setup

```

```nohighlight
--------------------------------
 D I E T - P I
 External Drive Setup
 --------------------------------
 An Existing ext4 Drive has Been Found

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 57G 584M 54G 2% /mnt/usb_1

 Would you like to format this drive? [y/N] y

```

```nohighlight
--------------------------------
 D I E T - P I
 External Drive Setup
 --------------------------------
 Drive ready to be formatted to EXT4

 WARNING: This will delete all data on the USB drive

 Do you wish to Format this drive? [y/N] y

```

![160505-0001.gif](https://dietpi.com/forum/uploads/default/original/1X/81ef35d486e5d90fa6ce8367e91a635db1ec5bf6.gif)

- Mounting USB device:

```nohighlight
root@RPi-B-Plus:~# mount /dev/sda1 /mnt/usb_1/

```

- Benchmark Filesystem and RAM IO performance

```nohighlight
root@oDroid-C1-TEST:~# dietpi-config

```

_10 Tools_ =\> _Benchmarks Filesystem and RAM benchmarks_ =\> _Flash Storage, USB Drive, RAM_ =\> Benchmark IO performance.  
 ![160505-0002.gif](https://dietpi.com/forum/uploads/default/original/1X/128a57c21573cfa9cbe99f5d74ba21bce8fee971.gif)  
**# Preparing to change root device (system)**

- Now we need _ **Partition unique UUID** _ (UUID) of the USB device:

```nohighlight
root@oDroid-C1-TEST:~# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
└─sda1 ext4 abe28749-d59f-415b-9b60-75b1007eeee9 /mnt/usb_1
mmcblk0
├─mmcblk0p1 vfat BOOT 6E35-5356 /boot
└─mmcblk0p2 ext4 rootfs e139ce78-9841-40fe-8823-96a304a09859 /

```

e.g. _Partition unique UUID: **abe28749-d59f-415b-9b60-75b1007eeee9** _

- Backup your _ **boot.ini** _ file and edit it to include your new partition:

```nohighlight
root@oDroid-C1-TEST:~# cp /DietPi/boot.ini /DietPi/boot.ini.sdcard
root@oDroid-C1-TEST:~# nano /DietPi/boot.ini

```

- Edit the file and change your **_root=UUID=…_** to point to new filesystem partition with the find out _Partition unique UUID ( **UUID** )_

```nohighlight
# Boot Arguments
## Boot from SD-Card
## setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro ${condev} no_console_suspend vdaccfg=0xa000 logo=osd1,loaded,0x7900000,720p,full dmfc=3 cvbsmode=576cvbs hdmimode=${m} m_bpp=${m_bpp} vout=${vout_mode} ${disableuhs} ${hdmi_hpd} ${hdmi_cec} ${enabledac}"

## Boot from USB device
setenv bootargs "root=UUID=abe28749-d59f-415b-9b60-75b1007eeee9 rootwait rootdelay=10 ro ${condev} no_console_suspend vdaccfg=0xa000 logo=osd1,loaded,0x7900000,720p,full dmfc=3 cvbsmode=576cvbs hdmimode=${m} m_bpp=${m_bpp} vout=${vout_mode} ${disableuhs} ${hdmi_hpd} ${hdmi_cec} ${enabledac}"

```

Watch for "_ **rootdelay=10** _ " and save the file!

* * *

- **_Examples for other ODROID devices:_**

- _- - - C2 - - -_

```nohighlight
# Boot Arguments
## Boot from SD-Card
## setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw ${condev} no_console_suspend hdmimode=${m} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0"

## Boot from USB device
setenv bootargs "root=UUID=abe28749-d59f-415b-9b60-75b1007eeee9 rootwait rootdelay=10 rw ${condev} no_console_suspend hdmimode=${m} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0"

```

- _- - - XU4 / XU3 (tested by user) - - -_

```nohighlight
 #------------------------------------------------------------------------------------------------------
# Basic Ubuntu Setup. Don't touch unless you know what you are doing.
# --------------------------------
## Boot from SD-Card
## setenv bootrootfs "console=tty1 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes"

## Boot from USB device
setenv bootrootfs "console=tty1 root=UUID=abe28749-d59f-415b-9b60-75b1007eeee9 rootwait rootdelay=10 ro fsck.repair=yes"

```

As well watch for “ _root=UUID= …_ ” and " _rootdelay=10_ " !

* * *

- Stop the services:

```nohighlight
root@oDroid-C1-TEST:~# /DietPi/dietpi/dietpi-services stop

 DietPi-Services
 Mode: stop
 Please wait...
 Completed

```

- Copy the filesystem over to your new partition:

```nohighlight
root@oDroid-C1-TEST:~# rsync -axv / /mnt/usb_1/
...
sent 485,999,479 bytes received 431,075 bytes 7,314,745.17 bytes/sec
total size is 484,388,706 speedup is 1.00

```

Be patient - this will take some time!

- Get your partition _ **UUID** _ for fstab:

```nohighlight
root@oDroid-C1-TEST:~# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
└─sda1 ext4 abe28749-d59f-415b-9b60-75b1007eeee9 /mnt/usb_1
...

```

e.g. _UUID= **abe28749-d59f-415b-9b60-75b1007eeee9** _

- Backup and edit the fstab file on your new filesystem:

```nohighlight
root@oDroid-C1-TEST:~# cp /mnt/usb_1/etc/fstab /mnt/usb_1/etc/fstab.sdcard
root@oDroid-C1-TEST:~# nano /mnt/usb_1/etc/fstab

```

- Comment out the old filesystem at _ **/dev/mmcblk0p2** _ and add the new line pointing to your new filesystem and add your _ **UUID** _ as indicated.

```nohighlight
#Internal Drives---------------------------------------------------
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults,noatime,discard 0 2
## rootfs on SD-Card
### /dev/mmcblk0p2 / ext4 defaults,noatime,discard 0 1
## rootfs on USB device
/dev/disk/by-uuid/abe28749-d59f-415b-9b60-75b1007eeee9 / ext4 defaults,noatime,nodiratime 0 1
tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0
tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0
tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0

```

- Comment out External Drives at _ **/dev/sda1 \_\_\_ /mnt/usb\_1** _ :

```nohighlight
#External Drives---------------------------------------------------
# - Try and use only ext4 for USB drives
# - Faster performance than NTFS, espically on RPi v1
## /dev/sda1 /mnt/usb_1 ext4 defaults,noatime,nofail 0 0
#/dev/sda1 /mnt/usb_1 ntfs-3g defaults,permissions,noatime,nofail 0 0

```

and save the file!

- Unmount your USB device:

```nohighlight
root@oDroid-C1-TEST:~# umount /dev/sda1

```

- Cross the fingers and reboot your ODROID:

```nohighlight
root@oDroid-C1-TEST:~# reboot

```

If your USB device have a activity LED, you can check here R/W activity.  
Boot up time is now: ca. 20 sec

- After your device has booted up, check the filesystem information:

```nohighlight
root@oDroid-C1-TEST:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 57G 581M 54G 2% /
udev 10M 0 10M 0% /dev
tmpfs 190M 5.4M 185M 3% /run
tmpfs 475M 0 475M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 475M 0 475M 0% /sys/fs/cgroup
tmpfs 10M 1.1M 9.0M 11% /DietPi
tmpfs 20M 12K 20M 1% /var/log
tmpfs 475M 0 475M 0% /tmp
/dev/mmcblk0p1 129M 25M 104M 20% /boot

```

- Create a new swap file (e.g. 101 MB):

```nohighlight
root@oDroid-C1-TEST:~# dietpi-config

```

_dietpi-config_ =\> _4 Advanced Options_ =\> _1 Swapfile Size_  
 ![160505-0003.gif](https://dietpi.com/forum/uploads/default/original/1X/417758a92e4fb28b30436d7ea14ee35b60f849dd.gif)

- Now benchmark filesystem and RAM IO performance again:  
 ![160505-0004.gif](https://dietpi.com/forum/uploads/default/original/1X/50d1394b403430e527c6cea6bb93b68ae7c3bca4.gif)  
… and reboot.  
  
  
**_Note:_**
- To boot your device, you must have insert SD-Card any time. Without it will not boot.
- If somethings goes wrong or your device doesn’t boot, power off your device, put SD-Card into your PC and restore "_ **boot.ini.sdcard** _ " to "_ **boot.ini** _ " on the DOS (FAT) partition named " **_boot_**"  
Put edited SD-Card back into your device and power on. It will boot and run the system (DietPi) now from SD-Card like before your modifications.

* * *

---

<div class="post-metadata">

**Author:** ![mike175de](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@mike175de](https://dietpi.com/forum/u/mike175de)\
**Post date:** [5 May 2016 19:46 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/4 "2016-05-05T19:46:15Z")

</div>

Hey k-plan,

thx a lot for this great tutorial! 😃

Worked like a charm!

This one should get a sticky in the board.

Thx again for your time, support and sharing your knowledge. :mrgreen:

mike175de

---

<div class="post-metadata">

**Author:** ![k-plan](https://dietpi.com/forum/user_avatar/dietpi.com/k-plan/32/12_2.png) [@k-plan](https://dietpi.com/forum/u/k-plan)\
**Post date:** [7 May 2016 16:50 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/5 "2016-05-07T16:50:40Z")

</div>

Hi Mike,

very nice to hear, it’s working for you.

Thanks for your response.

cu  
k-plan

---

<div class="post-metadata">

**Author:** ![dyteso](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@dyteso](https://dietpi.com/forum/u/dyteso)\
**Post date:** [8 May 2016 04:48 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/6 "2016-05-08T04:48:17Z")

</div>

Hi k-plan

I was able to do what I needed. Great tutorial and pictures. Easy to follow. I couldn’t have ask for more. Thanks a lot. You can say that UX4 has been tested successfully.

Thanks once again

Jorge

---

<div class="post-metadata">

**Author:** ![k-plan](https://dietpi.com/forum/user_avatar/dietpi.com/k-plan/32/12_2.png) [@k-plan](https://dietpi.com/forum/u/k-plan)\
**Post date:** [8 May 2016 08:45 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/7 "2016-05-08T08:45:30Z")

</div>

Hi dyteso,

> [@dyteso](#):
>
> You can say that UX4 has been tested successfully

Done! 😃

Thanks for your response.

cu  
k-plan

---

<div class="post-metadata">

**Author:** ![johnvick](https://dietpi.com/forum/user_avatar/dietpi.com/johnvick/32/16_2.png) [@johnvick](https://dietpi.com/forum/u/johnvick)\
**Post date:** [23 June 2016 06:29 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/8 "2016-06-23T06:29:36Z")

</div>

Great guide thanks - just got this going on an XU4.

---

<div class="post-metadata">

**Author:** ![korniza](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/3bc359/32.png) [@korniza](https://dietpi.com/forum/u/korniza)\
**Post date:** [30 July 2016 06:58 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/9 "2016-07-30T06:58:18Z")

</div>

I had moved my root to usb SSD before months on Odroid XU4. Today my SD died so it did not boot. How can I keep the installation on SSD and perform a new installation on a new SD? 🤔🤔🤔  
Any idea? Please HELP!

---

<div class="post-metadata">

**Author:** ![johnvick](https://dietpi.com/forum/user_avatar/dietpi.com/johnvick/32/16_2.png) [@johnvick](https://dietpi.com/forum/u/johnvick)\
**Post date:** [30 July 2016 19:33 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/10 "2016-07-30T19:33:45Z")

</div>

First are you sure the SD card has died? Have you tried to read/copy it on a Windows machine?

I would backup the SSD just in case, flash a new SD card with dietpi and use the instructions earlier in this thread to rebuild your system as it was.

Refer specifically to the sections on UUID and editing the boot.ini file.

---

<div class="post-metadata">

**Author:** ![percivul](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/898d66/32.png) [@percivul](https://dietpi.com/forum/u/percivul)\
**Post date:** [12 May 2018 20:56 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/11 "2018-05-12T20:56:30Z")

</div>

Could this be updated now that the external drive scripts aren’t there anymore? I tried to do it manually (XU4) and everything was fine until the first reboot. It would be great if we could get drive-manager to find used or blank USB sticks & SDD’s to be setup and used for RootFS.

Thanks

---

<div class="post-metadata">

**Author:** ![rob33](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/d9b06d/32.png) [@rob33](https://dietpi.com/forum/u/rob33)\
**Post date:** [19 June 2018 13:36 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/12 "2018-06-19T13:36:05Z")

</div>

Can i use this for the HC1/2? I only want to use the Hardrive for my userdata (Nextcloud/Ampache…) or is there an other way? During a fresh install i cant choose the hardrive (topic: [https://dietpi.com/forum/t/odroid-hc2-cant-use-mount-hard-disk-edited/2341/1](https://dietpi.com/forum/t/odroid-hc2-cant-use-mount-hard-disk-edited/2341/1))

---

<div class="post-metadata">

**Author:** ![MichaelTew](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@MichaelTew](https://dietpi.com/forum/u/MichaelTew)\
**Post date:** [27 June 2018 20:26 UTC](https://dietpi.com/forum/t/tutorial-outdated-odroid-move-the-filesystem-to-a-usb-drive/328/13 "2018-06-27T20:26:35Z")

</div>

It doesn’t seem to be showing up, yet. Are you going to add this to the Wiki, too?
