What's new

Merge 2 partition from telnet

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

WulkanOS

Occasional Visitor
Hi guys
I've attache usb hdd to my RT-AC86U. 2 partition - ext4 and ntfs. Can I delete ntfs and connect to partition ext4 from telnet ?
 
Not if you only have that one HDD connected to the router. It would be much easier to plug the HDD into a Linux PC and use it's GUI to delete the NTFS partition then expand the ext4 partition and filesystem.
 
Is the ext4 partition mounted while you're making the attempt?
Tis is typically the problem when trying to perform any partition operations with ext4. There is typically either an active program preventing the partition from being umounted before performing the operations, or the userland is forgetting to dismount before performing the operations.

One way to tell if a program is actively hindering the umount process is to use lsof.

For example, I have seen instances using lsof where router processes were performing "scanning" rituals on the partition I wanted to unmount.

lsof /dev/sda1 <<<------Adjust the path to the device according to your setup needs.

Below shows some example router processes which will prevent the unmount of partitions.
Code:
455509  /usr/sbin/vsftpd        /dev/null
455509  /usr/sbin/vsftpd        /dev/null
455509  /usr/sbin/vsftpd        /dev/null
455509  /usr/sbin/vsftpd        socket:[2136]
455509  /usr/sbin/vsftpd        /proc/1/mounts
455509  /usr/sbin/vsftpd        /var/lock/usbnas.lock
455509  /usr/sbin/vsftpd        socket:[2458379]
455512  /usr/sbin/mt-daapd      /dev/null
455512  /usr/sbin/mt-daapd      /dev/null
455512  /usr/sbin/mt-daapd      /dev/null
455512  /usr/sbin/mt-daapd      socket:[2136]
455512  /usr/sbin/mt-daapd      /proc/1/mounts
455512  /usr/sbin/mt-daapd      /var/lock/usbnas.lock
455512  /usr/sbin/mt-daapd      /tmp/mnt/sdb1/.mt-daapd/songs.gdb
455512  /usr/sbin/mt-daapd      socket:[2458548]
455512  /usr/sbin/mt-daapd      socket:[2458462]
455515  /usr/sbin/minidlna      /dev/null
455515  /usr/sbin/minidlna      /dev/null
455515  /usr/sbin/minidlna      /dev/null
455515  /usr/sbin/minidlna      /tmp/mnt/sdb1/.minidlna/minidlna.log
455515  /usr/sbin/minidlna      /tmp/mnt/sdb1/.minidlna/files.db
455515  /usr/sbin/minidlna      socket:[2458695]
455515  /usr/sbin/minidlna      socket:[2458696]
455515  /usr/sbin/minidlna      socket:[2458701]
455515  /usr/sbin/minidlna      anon_inode:inotify
455528  /usr/sbin/miniupnpd     /dev/null
455528  /usr/sbin/miniupnpd     /dev/null
455528  /usr/sbin/miniupnpd     /dev/null
455528  /usr/sbin/miniupnpd     socket:[2136]
455528  /usr/sbin/miniupnpd     /proc/1/mounts
455528  /usr/sbin/miniupnpd     socket:[2458781]
455528  /usr/sbin/miniupnpd     socket:[2458782]
455528  /usr/sbin/miniupnpd     socket:[2458783]
455528  /usr/sbin/miniupnpd     socket:[2458785]
455528  /usr/sbin/miniupnpd     socket:[2458787]
455528  /usr/sbin/miniupnpd     /dev/urandom

It is important to first verify these processes are not performing important tasks before interrupting them to unmount.

One way to unmount in a way which prevents interruption is to "lazy" umount, but this requires waiting for an uncertain amount of time to completely unmount the partition.
 
Last edited:
Yeah. I see now I should've asked whether /any/ partitions were mounted...

While it may be possible to manipulate partitions in such a way, even if by force, while any are mounted, I would never recommend it. Am fairly certain I've never even /tried/ such.
 
Tis is typically the problem when trying to perform any partition operations with ext4. There is typically either an active program preventing the partition from being umounted before performing the operations, or the userland is forgetting to dismount before performing the operations.

One way to tell if a program is actively hindering the umount process is to use lsof.

For example, I have seen instances using lsof where router processes were performing "scanning" rituals on the partition I wanted to unmount.

lsof /dev/sda1 <<<------Adjust the path to the device according to your setup needs.

Below shows some example router processes which will prevent the unmount of partitions.
Code:
455509  /usr/sbin/vsftpd        /dev/null
455509  /usr/sbin/vsftpd        /dev/null
455509  /usr/sbin/vsftpd        /dev/null
455509  /usr/sbin/vsftpd        socket:[2136]
455509  /usr/sbin/vsftpd        /proc/1/mounts
455509  /usr/sbin/vsftpd        /var/lock/usbnas.lock
455509  /usr/sbin/vsftpd        socket:[2458379]
455512  /usr/sbin/mt-daapd      /dev/null
455512  /usr/sbin/mt-daapd      /dev/null
455512  /usr/sbin/mt-daapd      /dev/null
455512  /usr/sbin/mt-daapd      socket:[2136]
455512  /usr/sbin/mt-daapd      /proc/1/mounts
455512  /usr/sbin/mt-daapd      /var/lock/usbnas.lock
455512  /usr/sbin/mt-daapd      /tmp/mnt/sdb1/.mt-daapd/songs.gdb
455512  /usr/sbin/mt-daapd      socket:[2458548]
455512  /usr/sbin/mt-daapd      socket:[2458462]
455515  /usr/sbin/minidlna      /dev/null
455515  /usr/sbin/minidlna      /dev/null
455515  /usr/sbin/minidlna      /dev/null
455515  /usr/sbin/minidlna      /tmp/mnt/sdb1/.minidlna/minidlna.log
455515  /usr/sbin/minidlna      /tmp/mnt/sdb1/.minidlna/files.db
455515  /usr/sbin/minidlna      socket:[2458695]
455515  /usr/sbin/minidlna      socket:[2458696]
455515  /usr/sbin/minidlna      socket:[2458701]
455515  /usr/sbin/minidlna      anon_inode:inotify
455528  /usr/sbin/miniupnpd     /dev/null
455528  /usr/sbin/miniupnpd     /dev/null
455528  /usr/sbin/miniupnpd     /dev/null
455528  /usr/sbin/miniupnpd     socket:[2136]
455528  /usr/sbin/miniupnpd     /proc/1/mounts
455528  /usr/sbin/miniupnpd     socket:[2458781]
455528  /usr/sbin/miniupnpd     socket:[2458782]
455528  /usr/sbin/miniupnpd     socket:[2458783]
455528  /usr/sbin/miniupnpd     socket:[2458785]
455528  /usr/sbin/miniupnpd     socket:[2458787]
455528  /usr/sbin/miniupnpd     /dev/urandom

It is important to first verify these processes are not performing important tasks before interrupting them to unmount.

One way to unmount in a way which prevents interruption is to "lazy" umount, but this requires waiting for an uncertain amount of time to completely unmount the partition.
Ok but i trying resize partition under on pc from linux running on usb stick live and always unmount usb hdd
 
All (both?) partitions should not be mounted. For some time now live-USB-GNU/Linux most all "automount" everything on another USB device. They need to be unmounted but not by "ejecting" (or "safely removing") the device. I don't know the means to do that graphically so would pop open a terminal (usually ctr-alt-t), issue "sudo bash" then "df". The USB drive will likely be the last lines df outputs, /dev/sd?? (a letter and number). Issue "umount /dev/sdc1" (for example), for each partition mounted from that device. Then issue the command "gparted /dev/sd[whatever letter]".

Did you perform the full equivalent?

Can you otherwise write to the drive? A worn out thumb drive typically switches to read-only mode. If that's what you're up against you can forget trying to change anything about it, and ought to fetch everything you want/can off of it.
 
If you can delete the NTFS partition but cannot resize the EXT4 partition, then just create another EXT4 in the free space.
 
...... or save any of the files you want to keep, remove the existing partition then create one full partition.
Or am I missing something?
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Members online

Top