LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-30-2024, 09:52 AM   #1
Igor Evgen
Member
 
Registered: Mar 2019
Location: Ukraine
Posts: 38

Rep: Reputation: Disabled
Removing folders from portable drive


On my portable Store Jet "Transcend" some folders (kept from previous OS Windows) got unmovable and unnecessary. How to remove them?
Normal way "move to trash" doesn't work (computer writes "error" or "the file is not empty").
Neither helps Beach Bit.
Terminal writes "no such file in directory" -- and what is a proper command?
Thank you.
 
Old 04-30-2024, 10:28 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,970

Rep: Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334
what kind of filesystem is it? Probably would be better to save what you need and reformat the whole storage.
Without details hard to say more. There can be hidden or strange chars in filenames, there can be hardware error or corrupted filesystem or just a mistyped command. Or something else.
 
1 members found this post helpful.
Old 04-30-2024, 10:37 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,387

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
I Presume this is a ntfs drive? Or is it udf?
Have you tried something like this?
Code:
mount /dev/nutty-drive /media
rm -ri /media/*
It should spit you up a confirmation dialogue for each directory. There's things like Recycle.Bin which is listed as /media/$Recycle.Bin, and that '$' has to be escaped, i.e.
rm -rf /path/to/\$Recycle.Bin
 
1 members found this post helpful.
Old 04-30-2024, 12:55 PM   #4
Igor Evgen
Member
 
Registered: Mar 2019
Location: Ukraine
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
what kind of filesystem is it? Probably would be better to save what you need and reformat the whole storage.
Without details hard to say more. There can be hidden or strange chars in filenames, there can be hardware error or corrupted filesystem or just a mistyped command. Or something else.
Thanks for replying. My filesystem is Ubuntu 22.04 LTS. I think about reformatting too. Just hope for some sudo rm or unknown to me Linux tool which kicks whatsoever.

PS Another strange thing is that to get an answer from this forum, I have to (get out and) reenter it. Otherwise, it feels like nobody give a damn.
 
Old 04-30-2024, 01:25 PM   #5
Igor Evgen
Member
 
Registered: Mar 2019
Location: Ukraine
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
I Presume this is a ntfs drive? Or is it udf?
Have you tried something like this?
Code:
mount /dev/nutty-drive /media
rm -ri /media/*
It should spit you up a confirmation dialogue for each directory. There's things like Recycle.Bin which is listed as /media/$Recycle.Bin, and that '$' has to be escaped, i.e.
rm -rf /path/to/\$Recycle.Bin
Thanks. The code (if it's not a joke) didn't help.
Terminal answered: <special device /dev/nutty-drive does not exist>.
The "ntfs" it is.

The Transcend is a portable hard drive, StoreJet 25M3, USB 3.0.
When I open <hidden files>, it additionally shows
<.Trash-1000>.
The "stubborn" folder to be removed shows 4 folders, all responding as <the folder contents could not be displayed>.

So what, to reformat it?
 
Old 04-30-2024, 01:39 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,387

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Quote:
Originally Posted by Igor Evgen
So what, to reformat it?
Back up all valuable data and make a new partition of your choice Ext4 is the all-purpose file system, but there are others with their own peculiar strengths. I stick with ext4 for the repair tools, and I don't fit any of the use cases for the more exotic distros.
 
1 members found this post helpful.
Old 04-30-2024, 01:48 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,547

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Quote:
Terminal answered: <special device /dev/nutty-drive does not exist>.
THe 'nutty-drive' was an example so it is up to you to use or create a specific mount point wherever you wish but usually done in the /mnt or /media directories. Then you mount it.

Quote:
(computer writes "error" or "the file is not empty").
Was it actually 'folder is not empty'? Delete the sub-folders first. rm -rf dirname should do the job only if you have the full path to the correct directory or are in the directory immediately above the directory you want to remove.

Or do what is suggested in post 6 which might be simpler if you have no data there you want to save.

Last edited by yancek; 05-01-2024 at 06:41 AM. Reason: clarity
 
1 members found this post helpful.
Old 04-30-2024, 02:10 PM   #8
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,143
Blog Entries: 21

Rep: Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481
I reformatted my Toshiba 1TB drive that was NTFS to BTRFS file system because it lost everything stored in it while copying and pasting files from it.

Gparted handled that. I blame the NTFS file system for losing my backups. Now have only one from another laptop, but copy and paste.
Mount and dis mount. Work like they should.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script to compare folders,Sub-Folders and Sub-Sub-Folders unix_72427 Programming 8 08-08-2012 02:51 PM
Removing all portable computer related software in a desktop computer. stf92 Slackware 8 06-23-2010 09:24 AM
using flash drive/portable hard drive on BOTH Linux and Windows yankeegirl Linux - Hardware 2 10-07-2009 08:22 AM
need a portable linux distro to bring on portable usb hard drive... pippo17 Linux - Distributions 3 10-20-2008 06:41 AM
LXer: EDGE Tech Corp Announces Portable Flash Drive With Muscle - the New 8GB DiskGO!(TM) Now Available; Swap and Go With This Secure Thumb-Sized Flash Drive LXer Syndicated Linux News 0 12-14-2005 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration