How to Format Usb Drive

How to choose right file system for your usb disk? Simple, not FAT32 or NTFS because AsusWRT routers using Linux which is not Windows best friend  :)

For usb flash drives best choice is EXT2 (All AsusWRT routers)

For usb hdd Mipsel devices is EXT3 (RT-N16, RT-N66U, RT-AC66U and all other versions: /R /W)

For usb hdd ARM devices is EXT4 (RT-AC56U, RT-AC68U, RT-AC87U, RT-AC88U, RT-AC3200, RT-AC5300 and all other versions: /P /R /W)

Warning!!! Formatting the disk will destroy all existing data, please backup your files first, bigger disk capacity - longer time to format! :(

METHOD I - Directly from router

Plug usb device directly on router usb port.

To see how is mounted, type "mount" in teminal

mount
admin@RT-AC66U:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw)
devfs on /dev type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock5 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /tmp/mnt/sda1 type ext2 (rw,nodev,noatime,data=ordered)
nfsd on /proc/fs/nfsd type nfsd (rw)
admin@RT-AC66U:/tmp/home/root#

Usb disk is mounted as /dev/sda1

Format the disk to ext2, ext3 or ext4 (ext4 available only on arm routers)

mkfs.ext3 /dev/sda1

If you get error:

/dev/sda1 is mounted; will not make a filesystem here!

Go to default router ip address 192.168.1.1  click on usb icon and Eject Usb Disk

eject-usb

Now try to format again

mkfs.ext3 /dev/sda1
admin@RT-AC66U:/tmp/home/root# mkfs.ext3 /dev/sda1
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
123392 inodes, 493564 blocks
24678 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=507510784
16 block groups
32768 blocks per group, 32768 fragments per group
7712 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
admin@RT-AC66U:/tmp/home/root#

Reboot router or replug usb disk, then check if is mounted

mount
admin@RT-AC66U:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw)
devfs on /dev type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock5 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /tmp/mnt/sda1 type ext3 (rw,nodev,noatime,data=ordered)
nfsd on /proc/fs/nfsd type nfsd (rw)
admin@RT-AC66U:/tmp/home/root#

If you want to label the disk, use this command

tune2fs -L "desired_label" /dev/sda1

To delete the label

tune2fs -L "" /dev/sda1

In both cases you have to reboot, replug the disk or type next command

hotplug2
ls -l /tmp/mnt
drwxrwxrwx 3 admin root 4096 Nov 8 18:36 desired_label

Now the disk is labeled as desired_label :) and ready to install Entware or Optware

To check disk for errors use this command

e2fsck -fv /dev/sda1
admin@RT-AC56U:/tmp/home/root# e2fsck -fv /dev/sda1
e2fsck 1.42.8 (20-Jun-2013)
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 102505 inodes used (0.34%, out of 30523392)
1271 non-contiguous files (1.2%)
89 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 9018/369/7
47900728 blocks used (39.23%, out of 122088192)
0 bad blocks
15 large files 78500 regular files
8597 directories
0 character device files
0 block device files
0 fifos
334 links
15394 symbolic links (15110 fast symbolic links)
5 sockets
------------
102830 files
admin@RT-AC56U:/tmp/home/root#

METHOD II - From Windows OS
A - Download and install EaseUS Partition Master Free Edition

Plug usb drive in your pc usb port.

Open EaseUS Partition Master and with right click select desired disk

easeus-format1

 

Click Format partition and select desired file system, EXT2 for example

easeus-format2

Click Apply and Yes

easeus-format3

Wait until disk is formatted then remove it from pc and plug to router usb port.

easeus-format4

B - Download and install MiniTool Partition Wizard

Plug usb drive in your pc usb port.
Open MiniTool Partition Wizard and with right click select desired disk/partition
Click Format partition and select desired file system,  EXT4 for example
Click OK and Apply
...
The disk is ready now to install Entware or Optware


METHOD III- From Linux Ubuntu

only if requested by user...

  • Olariu

    what terminal putty hyper-terminal winscp

  • hotus94

    as for my DSL-AC68U modem/router from asus with latest firmawre I can use ext4 fs with no problem tested on cheap usb3 thumb drive from PNY formatted with MiniTool Partition Wizard Free on Win 10 Pro x64.

  • Martin

    This article is awesome. Thank you for sharing this information

    • TeHashX

      Thanks for feedback

  • Question

    What does /P /R /W stand for?

  • Bob Sinclar

    Where is the command line for ext4 and how could we had noatime and such options ? Thanks

    • TeHashX

      Did you install EaseUS Partition Master and don't have EXT4 option?
      You can also try MiniTool Partition Wizard Free Edition link

      • Bob Sinclar

        I made it with gparted on bootable linux but i want to disable journal with "noatime" argument but don't know how.. Could you help me ? I check /etc/fstab but it is empty. :(

        • TeHashX

          Try asking on forums

  • David Taylor

    Method 1 worked great to let me reformat my TB+ disk on AsusWRT-Merlin, 87U, via Putty. Goodbye NTFS, hello EXT3.

  • NoRouter

    Nice one. Thanks! Was wondering how to do this remotely without having to plug the usb into my laptop

Get Email Notification When a Server or Port is Unreachable
SoftEther VPN Running on AsusWRT Routers
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Spreed WebRTC server and web client
Asterisk VoIP Server running on AsusWRT Routers
Get Email Notification When a Server or Port is Unreachable
SoftEther VPN Running on AsusWRT Routers
NZBGet through Entware
Minidlna UPnP Media Server through Debian Jessie Arm

SUBSCRIBE

To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...