Turning NTFS usb into primary storage

Linksys e8450 ubi / belkin rt3200
OpenWRT Version 23.05.0
Usb 2.0

I am following this guide to have a ntfs usb be the main storage for the os (i dont actually need the os itself, just extra packages + transmission and its gigabyte files)

The usb is already formatted to ntfs and automounts at boot using "network shares" (or samba) to /dev/sda but i used a yt guide, not official guide to do this.

I am using ntfs so i can access transmission webui and move files into my windows pc.
I would actually use ext4 if i can freely move transmission files into my pc.
I dont want to corrupt my system so can i get corrections on the exact commands to use?

Starting at 1. Preperation I will change the ext4 to ntfs and leave the rest of the code alone right?

opkg update
opkg install block-mount kmod-fs-ext4 e2fsprogs parted
parted -s /dev/sda -- mklabel gpt mkpart extroot 2048s -2048s

In the next step i have to configure fstab to mount rootfs_data.

DEVICE="$(block info | sed -n -e '/MOUNT="\S*\/overlay"/s/:\s.*$//p')"
uci -q delete fstab.rwm
uci set fstab.rwm="mount"
uci set fstab.rwm.device="${DEVICE}"
uci set fstab.rwm.target="/rwm"
uci commit fstab

Do i replace anything on here? I think i delete ${device} and replace it with the UUID of the usb. Or do i put the UUID between { } and only delete the word "device"

In a later step i get this

eval $(block info ${DEVICE} | grep -o -e 'UUID="\S*"')
eval $(block info | grep -o -e 'MOUNT="\S*/overlay"')
uci -q delete fstab.extroot
uci set fstab.extroot="mount"
uci set fstab.extroot.uuid="${UUID}"
uci set fstab.extroot.target="${MOUNT}"
uci commit fstab

Do i delete the word between { } and put in the item? What is device? What is mount? I thought we were using /dev/sda as the default?

I assume all the other commands will work with copy paste

NTFS does not support the POSIX features required for use as overlay, this approach is not possible (at least not without major bugs and problems), you must use a linux filesystem for this.

3 Likes

Thanks :+1:

What does that mean?

Do you know if i can access the files transmission downloads if its ext4 and my pc is ntfs?

What do do with commands if i use ext4? What to put on {device}

Your approach (using extroot) seems unnecessary complicated.
You can just leave the operating system's file system to be as is, the default flash from router, and just config transmission to use your mounted NTFS drive for storage. There is no real need to extroot.

2 Likes

Why do you need the volume on the USB drive to be NTFS, are you unplugging it and moving it back and forth to your Windows PC?

Do i replace anything on here? I think i delete ${device} and replace it with the UUID of the usb. Or do i put the UUID between { } and only delete the word "device"

you don't need to edit that command at all. ${DEVICE} in this context is the variable named DEVICE that you just defined a couple lines above it. They've written this in such a fool-proof way that you can just copy and paste each line as-is, without having to find the drive's UUID yourself.

Do i delete the word between { } and put in the item? What is device? What is mount? I thought we were using /dev/sda as the default?

Again, just copy and paste it as-is. In the system's fstab file, you don't want to make entries that mount a volume as /dev/sda etc, you want to mount it using it's UUID, because although it's /dev/sda right now, once you reboot it might be /dev/sdb, but its UUID won't change. This group of commands is just a clever way of finding the drive's UUID and adding an entry to the fstab to mount it by said UUID.

2 Likes

You're right. I was complicating things too much.

ext4 filesystem can be read on PC (win) using third-party software. Common ground would be FAT32. NTFS is unnecessary complicated.
To transfer files from the USB pen to the PC, you can use file transfer, SCP. It is not necessary to plug/unplug the USB pen.

1 Like

I set up the usb as ext using exroot guide. It automounts and all that.

When following the guide i would use gdisk to view the drive, it kept saying it was GPT and has MBR protection.

I couldnt remove the mbr protected with gdisk or fdisk so i ignored that.

Should I worry about mbr protection?

I got transmission to work but it didnt download to the usb, i thought when using extroot that all additional software and files will be downloaded to the usb.

So now the router storage is full even after i pressed delete on transmission.

How do I go into the folders and manually delete the 1gb file transmission downloaded.

How do I make a new folder in the usb stick that transmission will download to?

The command i used to make a folder was

mkdir -p /overlay/dev/sda1/downloads

When putting the directory into transmission

/overlay/dev/sda1/downloads

I get permission denied, what am i doing wrong? What command can i use to view the list of folders?

Also i cant access transmission from the windows app but i can from the webui using

http://192.168.1.1:9091/transmission/web

what is the remote host? Do i need user/pass in the app?

When on the home screen the disk space is 200gb so the usb is properly part of the storage.
When on system>mount points>mount file systems i see that there is 2 200gb mounts. One has a mount point of /overlay with filesystem of /dev/sda1. Another has a mount point / and filesystem overlayfs:/overlay.

If you could assist me too that would be great

Which step ?

1 Like

Totally wrong.
You area mixing /overlay into picture. That means the normal flash...
(You are practically trying to say that lets keep a copy of everything on sda1 also on the small flash. )

Normally you never do anything into /overlay directly

Just access /dev/sda1 directly. Or actually, likely /mnt/sda1 is the normal file system instance of that drive. /dev/sda1 is the low-level device, not the mounted filesystem.

Ps.
/overlay is the r/w rootfs_data that normally get combined to r/o rootfs (ROM, flashed firmware) by overlayfs to create a unified "/" root file system where are changes are written to overlay.
External stuff on /dev/sda1 or /mnt/sda1 is outside of that.

3 Likes

Create a downloads file that transmission will use as a save location

List all the folders to verify the address of the downloads file and clean up any extra folders i accidentally created

Put in the correct "Remote host" for transmission app (not webUI)

I found How to enter the Root folder? - #2 by eduperez which told me the remote host is the ip that you use to access your router which is 192.168.1.1 (include this in the guide please)
It also let me access my router using webui, pretty cool.

But now where do large files go?
In /dev folder, /sbin folder, /usr folder, /mnt/sda folder?
Its a lot of gb I'm moving into the usb so I'd rather use my usb more than my router storage since.

I have never used transmission.
I'm quite sure the use a production router for the purpose of downloading is a bad idea. Keep it for its main role: routing.

1 Like

I think we missed the point of one of OP's questions; as far as the file share, the underlying file system doesn't matter, when you're sharing the files over SMB/NFS it's the files that are being shared, not the filesystem itself, so the network share will work the same no matter what filesystem is being used underneath it; NTFS, exFAT, ext2/3/4, xfs, whatever, the device mounting the SMB share doesn't have block-level access to it like with a iSCSI target or something. Think block storage vs. file storage.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.