LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2011, 08:35 PM   #1
schach42
LQ Newbie
 
Registered: Jul 2010
Distribution: Slackware 13.1
Posts: 12

Rep: Reputation: 0
"Operation not permitted" rm -rf Files from portable harddrive


I mounted a drive to back up some data, but first wanted to delete the data that is current on the drive.

Code:
# mount /dev/sdb1 mountpoint/
# cd sansa
# rm -rf file
rm: cannot remove 'file': Operation not permitted
# cp ../file2 .
cp: cannot create regular file `file2': Permission denied
# ls -l
drwx------ 1 root root        4096 [date] file
# ls -l ..
drwx------  1 root root    8192 [date] mountpoint
So I should have permissions to do this as root, but can't. It's a western digital "My Passport" drive. I've had it for about a year but haven't used it in months. Any thoughts?

Thanks for reading/responding.
 
Old 05-28-2011, 08:59 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Looks like it's mounted read-only. What's in /proc/mounts? Try mounting it read-write

mount -o remount,rw /dev/sdb1 mountpoint/
 
1 members found this post helpful.
Old 05-28-2011, 09:29 PM   #3
schach42
LQ Newbie
 
Registered: Jul 2010
Distribution: Slackware 13.1
Posts: 12

Original Poster
Rep: Reputation: 0
Code:
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext4 rw,relatime,barrier=1,data=ordered 0 0
devtmpfs /dev devtmpfs rw,relatime,size=507524k,nr_inodes=126881,mode=755 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
usbfs /proc/bus/usb usbfs rw,relatime 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/sdb1 /home/user/sansa ntfs rw,relatime,uid=0,gid=0,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1 0 0
The folder directory is called "sansa," as you can see. Also, mounting with -o rw didn't work. Any thoughts from /proc/mounts?
 
Old 05-28-2011, 11:48 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Oh, so it's NTFS. Which Linux is this, Slackware 13.1?

Anything in the syslog or the tail of `dmesg` about the partition?
 
Old 05-29-2011, 12:21 AM   #5
schach42
LQ Newbie
 
Registered: Jul 2010
Distribution: Slackware 13.1
Posts: 12

Original Poster
Rep: Reputation: 0
Yes, Slackware 13.1

Code:
# dmesg
NTFS volume version 3.1.
usb 1-6: USB disconnect, address 2
usb 1-6: new high speed USB device using ehci_hcd and address 3
usb 1-6: New USB device found, idVendor=1058, idProduct=070a
usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-6: Product: My Passport 070A
usb 1-6: Manufacturer: Western Digital
usb 1-6: SerialNumber: 575845314132303631353037
scsi9 : usb-storage 1-6:1.0
scsi 9:0:0:0: Direct-Access     WD       My Passport 070A 1032 PQ: 0 ANSI: 4
sd 9:0:0:0: Attached scsi generic sg2 type 0
scsi 9:0:0:1: CD-ROM            WD       Virtual CD 070A  1032 PQ: 0 ANSI: 4
sr1: scsi3-mmc drive: 51x/51x caddy
sr 9:0:0:1: Attached scsi CD-ROM sr1
sr 9:0:0:1: Attached scsi generic sg3 type 5
scsi 9:0:0:2: Enclosure         WD       SES Device       1032 PQ: 0 ANSI: 4
ses 9:0:0:2: Attached Enclosure device
ses 9:0:0:2: Attached scsi generic sg4 type 13
sd 9:0:0:0: [sdb] 975400960 512-byte logical blocks: (499 GB/465 GiB)
sd 9:0:0:0: [sdb] Write Protect is off
sd 9:0:0:0: [sdb] Mode Sense: 23 00 10 00
sd 9:0:0:0: [sdb] Assuming drive cache: write through
sd 9:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 9:0:0:0: [sdb] Assuming drive cache: write through
sd 9:0:0:0: [sdb] Attached SCSI disk
So as NTFS (I'm surprised I missed that--I know NTFS seemed oddly familiar, but it's been years since I seriously used Linux and I forget so much) would I have to reformat it and then partition it with a new compatible filesystem? However, I managed to write the data to the drive while on a Linux system (It may have been Ubuntu, and I forget which release, in preparation to change to Slackware 13.1), so I don't think that should be necessary.
 
Old 05-29-2011, 05:55 AM   #6
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Since you say that the drive has not been used for months I would suggest doing a file system check 'fsck -y -a /dev/sdb1'.
Also check the attributes of the files with 'lsattr <filename>'.
These are the two things I can think of currently that would make the external drive behave this way.
Hope this helps.
 
Old 05-29-2011, 06:07 AM   #7
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 239

Rep: Reputation: 14
I dont know much about slackware, but can you tell me why can't you switch to root user ? As i can understand its just the matter of permission (in your first post its showing only root privileged access).
 
Old 05-29-2011, 08:59 AM   #8
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Quote:
Originally Posted by SilverBack View Post
Since you say that the drive has not been used for months I would suggest doing a file system check 'fsck -y -a /dev/sdb1'.
Errr, fscking an NTFS partition from Linux???? Unless that's changed recently.. bad idea.

Booting Windows and running chkdsk on the partition might help, though.

I'm not familiar with Slackware, but 13.1 sounds relatively recent. Make sure your system is up to date.. and try googling "slackware ntfs" for tips; maybe you need to install a different package to better support NTFS.

@NM04 he's denied even as root.
 
Old 05-29-2011, 10:42 AM   #9
schach42
LQ Newbie
 
Registered: Jul 2010
Distribution: Slackware 13.1
Posts: 12

Original Poster
Rep: Reputation: 0
I got it working. Here's what I did:

Installed FUSE: http://fuse.sourceforge.net/
Installed ntfs-3g: http://www.tuxera.com/community/ntfs-3g-download/

And then used the command
Code:
# ntfs-3g /dev/sdb1 mountpoint
And it works fine. Thank you.

And why would fscking a NTFS partition be a bad idea?

Last edited by schach42; 05-29-2011 at 10:43 AM.
 
Old 05-29-2011, 11:40 AM   #10
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Windows should be used to fsck an NTFS partition. Historically, Linux has not supported NTFS well (this has changed in the past few years) and has not been able to fsck ntfs partitions. Seems there is some support for it now in the ntfsfix program tho.
 
Old 05-29-2011, 03:10 PM   #11
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Well I have a ntfs formatted pen drive and so far things are ok. Never needed to run a fsck on it AFAIK. Well, I guess I would need to go back to vfat .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
"creating symbolic link" "operation not permitted" wheni Linux - Newbie 3 05-08-2011 02:36 AM
Logged in as "root"/Fedora 8 but get "Operation not permitted" when using "chmod etc gosunlee Linux - Newbie 7 02-10-2008 06:56 AM
hdparm -d1 /dev/hda gives me "HDIO_SET_DMA failed: Operation not permitted" elluva Linux - Hardware 7 07-21-2007 04:49 AM
"Operation not permitted" error logging in to Ubuntu Dapper Drake paulBottomley Linux - Newbie 7 08-10-2006 12:13 PM


All times are GMT -5. The time now is 08:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration