How Can i extroot on an external hard drive?

I am a complete beginner. I have an orico external hard drive enclosure with 500 gb hdd i have already partitioned 1 gb of it to extroot but the problem is i dont know if it will work or not as my hdd enclosure has a feature that automatically spins down the hdd if it is not in use will it create any problem?

I also have another concern do i need to format the whole drive to ext4 or only doing the 1gb will be okay and is there any way to extroot from luci interface without using ssh?

If i cant use the hdd then can i hook up a usb hub and plug in a pendrive along with the hard drive and use the pendrive to extroot?

I am using a dlink router(Dir 1960) I am a complete beginner I would have bought a router but due to recession i can't do it now so it will be a massive help if i can tweek my. Existing and reuse it

I. Am currently having huge problem with it as the included dlink defend app and its features freezes the router

Theoretically, any drive should work via USB, even if it has energy saving features. It may just slow down certain operations. You only need to format the extroot partition as ext4, the other partition(s) can be whatever you need/want.

But why do you want to use a spinning platter disk instead of a simple USB stick? Frankly, even a 64MB (yes, megabytes) is sufficient for most things OpenWrt, unless you need more space because you are planning on sharing files from the device (not really the best option, but yes, doable).

2 Likes

I can't extroot in the partition i made. It is kinda weird as when i extroot via ssh it shows that extrooting was successful as files also gets moved to extrooted space but after that when i go to mount points in luci it doesn't show up i also cant mount it as root filesystem/overlay from luci as it just doesn't mount
It also doesn't show up in software .

I am so a bit confused as my router has 256 gb of flash memory but i can only use 25 mb of that to actually install softwares although it shows 182 mb available under status tab and the worst thing is just after installing file system and its dependencies i am only left with 2.1mb of free space i am super confused. Any help will be much appreciated.




I have added pictures of it

Did you follow the extroot guide and include the fstab modifications?

Let's see the output of the following:

  • unplug the USB drive and then reboot the router, issue uci show fstab and also df -h
  • plug in the USB drive, reboot the router, issue the same commands.

Please be sure to copy/paste the output directly into this forum using the </> code block formatting.

Yeah i followed the guide step by step still not fixed

Without usb device plugged in

root@OpenWrt:~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0' 
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@mount[0]=mount
fstab.@mount[0].enabled='0'
fstab.@mount[0].uuid='93065943-b4cf-4428-bee1-6ea4a98676a7'
fstab.@mount[0].target='/'
root@OpenWrt:~#
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                   123.1M     88.0K    123.0M   0% /tmp
/dev/ubi0_1              24.3M     22.3M    768.0K  97% /overlay
overlayfs:/overlay       24.3M     22.3M    768.0K  97% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# />

With usb device plugged in

root@OpenWrt:~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@mount[0]=mount
fstab.@mount[0].enabled='0'
fstab.@mount[0].uuid='93065943-b4cf-4428-bee1-6ea4a98676a7'
fstab.@mount[0].target='/'
root@OpenWrt:~#
root@OpenWrt:~#
root@OpenWrt:~#
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                   123.1M     88.0K    123.0M   0% /tmp
/dev/ubi0_1              24.3M     22.3M    768.0K  97% /overlay
overlayfs:/overlay       24.3M     22.3M    768.0K  97% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~#

Partition table

root@OpenWrt:~# fdisk -l
Disk /dev/mtdblock0: 512 KiB, 524288 bytes, 1024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock1: 512 KiB, 524288 bytes, 1024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock2: 256 KiB, 262144 bytes, 512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock3: 256 KiB, 262144 bytes, 512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock4: 40 MiB, 41943040 bytes, 81920 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock6: 36 MiB, 37748736 bytes, 73728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock7: 32 MiB, 33554432 bytes, 65536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock8: 40 MiB, 41943040 bytes, 81920 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock9: 6 MiB, 6291456 bytes, 12288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock10: 8.5 MiB, 8912896 bytes, 17408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/ubiblock0_0: 3.75 MiB, 3936256 bytes, 7688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: nal USB 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf034acf4
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048   8390655   8388608     4G  7 HPFS/NTFS/exFAT
/dev/sda2         8390656  81911807  73521152  35.1G  7 HPFS/NTFS/exFAT
/dev/sda3        81915435 976768064 894852630 426.7G  f W95 Ext'd (LBA)
/dev/sda5        81915498 260879534 178964037  85.3G  7 HPFS/NTFS/exFAT
/dev/sda6       260879598 439843634 178964037  85.3G  7 HPFS/NTFS/exFAT
/dev/sda7       439843698 618807734 178964037  85.3G  7 HPFS/NTFS/exFAT
/dev/sda8       618807798 797771834 178964037  85.3G  7 HPFS/NTFS/exFAT
/dev/sda9       797771898 976768064 178996167  85.4G  7 HPFS/NTFS/exFAT
root@OpenWrt:~#

With Fdisk -l command it shows dev/sda1 as Ntfs/exfat although in luci under mount points page it is shown as ext4 i have also formatted it to ext4 using ssh.

I have tried to mount it many times as root/overlay it just loads the page and nothing changes but i can to mount it as directory like mnt/sda2

Your drive sda has no ext4 partitions.

From manual above:

DEVICE="/dev/sda1"
mkfs.ext4 ${DEVICE}

Looks like it is not enabled. Try changing this to 1 and the rebooting.

I have already formatted the partition to ext4 using the command 4 times still same output

Can you tell me exactly how can i do that

I have already formatted the partition to ext4 using the command 4 times still same output still same

uci set fstab.@mount[0].enabled='1'
uci commit fstab

After using the command still facing same problem

After i use first 4 line of this it mounts 2 partition 1 as /tmp/cproot as /mnt then it moves the files to the extroot but after that when i use umount /tmp/cproot /mnt it unmount both of them and it doesn't work even after reboot

mkdir -p /tmp/cproot
mount --bind /overlay /tmp/cproot
mount ${DEVICE} /mnt
tar -C /tmp/cproot -cvf - . | tar -C /mnt -xf -	
umount /tmp/cproot /mnt
reboot

After rebooting 2 partition appear in mount points in luci but they just doesn't gets mounted not even from luci i have added the picture