LinuxQuestions.org
Visit Jeremy's Blog.
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 02-09-2011, 04:45 PM   #1
ellisgeek
LQ Newbie
 
Registered: Feb 2011
Location: The Intertubz
Distribution: Debian 6.0 Squeeze, Ubuntu
Posts: 5

Rep: Reputation: 0
Question NTFS mounts but can't remove files/directories


Hi this is my first post and I am not sure if this belongs here or in hardware.

Now for the main post!

setup:
Dell Demension 4400
Intel(R) Pentium(R) 4 CPU 1.60GHz, 1 cores
hda: 40 gb
hda1: ext3 linux install
hda2: ntfs windows xp
hda3: swap
hdb: 250 gb
hdb1: ntfs old data
hdb2: ext3 new data
network:
eth0: ethernet 7mbps cable line
eth1: netgear wifi b/g not in use

Sorry for the sketchy info
I am not near my box at the moment.

I have been setting up a server following the massive tutorial on woodel.com. It is remotely manageable using Webmin. Everything was going along great until I attempted to delete some data from from my old ntfs data partition. (image here http://imm.io/3E5Q) Is there any thing that I am doing wrong? Can I convert the partition safely? How can I mount it so that I can delete stuff?

Thanks in advance
Ellisgeek
 
Old 02-09-2011, 05:55 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 241

Rep: Reputation: 52
Greetings,

Well, my first thought would be if you have the proper support in your kernel to be able to write to an NTFS filesystem.

To give you an idea of what I'm referring to, here is a snippet from my kernel config file:
Code:
#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
CONFIG_NTFS_FS=y
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y
To be able to delete from an NTFS filesystem, you have to be able to write to it.

To check if you have the required setting, see if your distro (READ: distribution) of linux creates a /proc/config.gz file. If so, then you just need to do a less on it and search on "NTFS".
Code:
 ~ $ less /proc/config.gz
then type /NTFS.

This way we are checking the configuration of the running kernel's config.

If the distro doesn't create a /proc/config.gz, then first we have to know which kernel version we are running. To do that, we use uname. As an example:
Code:
 ~ $ uname -r
2.6.24-28-generic
Now, check if you see any "config-*" files in the /boot/ directory. If not, as root, mount /boot/
Code:
 ~ # mount /boot/
and, from the above example, we are looking for config-2.6.24-28-generic:
Code:
 ~ # less /boot/config-2.6.24-28-generic
and once we are looking at the current-running kernel's config file, we type /NTFS which will take us to the right section. An example from a default Ubuntu installation that doesn't have the necessary support for writing to an NTFS filesystem, but has a module to support mounting and reading one:
Code:
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_FS=m
# CONFIG_NTFS_RW is not set
What you need to see is the CONFIG_NTFS_RW with a "=y" or "=m", and you should have the proper support to do the delete.

Hope that helps. Let us know.
 
Old 02-09-2011, 06:49 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Please indicate which Linux distro you are using. Often the "fuse" kernel module needs to be loaded with the "ntfs-3g" package installed to enable rw mounting of drives. A Red Hat RHEL server may not include NTFS support by default, because it wouldn't normally be needed in a Linux server.

In your /etc/fstab entry for this partition, you need may need to use the uid & gid mount options. Because the NTFS filesystem isn't a Linux/Unix native filesystem, the ownership and permissions are set when the filesystem is mounted.

You could also mount the partition manually as well. Here is an example mount command:
sudo mount -t ntfs-3g /dev/sdd1 /mnt/craig/ -o rw,uid=craig,gid=users,nodev,noexec,utf8,fmask=0111,dmask=0000

The uid= entry determines the owner; gid= determines the group; fmask determines the permissions of the files; dmask determines the permissions of the directories.

It seems strange that the device node for the ntfs partition is /dev/hda2. A device node such as /dev/sda2 is normal for recent kernels. Which distro and version are you using? If it is years old, you probably want to update to something that has security updates.
 
Old 02-09-2011, 07:48 PM   #4
ellisgeek
LQ Newbie
 
Registered: Feb 2011
Location: The Intertubz
Distribution: Debian 6.0 Squeeze, Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
OOps sorry

Quote:
Originally Posted by jschiwal View Post
Please indicate which Linux distro you are using. Often the "fuse" kernel module needs to be loaded with the "ntfs-3g" package installed to enable rw mounting of drives. A Red Hat RHEL server may not include NTFS support by default, because it wouldn't normally be needed in a Linux server.

In your /etc/fstab entry for this partition, you need may need to use the uid & gid mount options. Because the NTFS filesystem isn't a Linux/Unix native filesystem, the ownership and permissions are set when the filesystem is mounted.

You could also mount the partition manually as well. Here is an example mount command:
sudo mount -t ntfs-3g /dev/sdd1 /mnt/craig/ -o rw,uid=craig,gid=users,nodev,noexec,utf8,fmask=0111,dmask=0000

The uid= entry determines the owner; gid= determines the group; fmask determines the permissions of the files; dmask determines the permissions of the directories.

It seems strange that the device node for the ntfs partition is /dev/hda2. A device node such as /dev/sda2 is normal for recent kernels. Which distro and version are you using? If it is years old, you probably want to update to something that has security updates.
I am running Debian Squeeze
Kernal: 2.6.32-5-686

Here is the complete output of inxi:

System: Host Debian-Server Kernel 2.6.32-5-686 i686 (32 bit) Distro Debian GNU/Linux 6.0

CPU: Single core Intel Pentium 4 (-UP-) cache 256 KB flags (sse sse2) bmips 3189.74 clocked at 1594.870 MHz

Graphics: Card nVidia NV11 [GeForce2 MX/MX 400] X.org 1.7.7 Res: 80x24 Gfx Data: N/A for root out of X

Audio: Card Intel 82801BA/BAM AC'97 Audio Controller driver Intel ICH at ports e800 ef00 BusID: 00:1f.5
Sound: Advanced Linux Sound Architecture Version 1.0.21

Network: Card-1 Atheros AR5212/AR5213 Multiprotocol MAC/baseband processor driver ath5k v: 0.6.0 BusID: 02:0c.0
Card-2 D-Link System RTL8139 Ethernet driver 8139too v: 0.9.28 at port d800 BusID: 02:0a.0

Disks: HDD Total Size: 360.1GB (1.2% used) 1: /dev/sda ST340016A 40.0GB
2: /dev/sdb WDC_WD3200AAJB 320.1GB

Partition: ID:/ size: 18G used: 3.9G (24%) fs: ext3 ID:swap-1 size: 0.89GB used: 0.00GB (0%) fs: swap

Info: Processes 84 Uptime 4:39 Memory 64.8/502.4MB Runlevel 2

Client Shell inxi 1.4.23

Hope it helps

P.S. i have no /proc/config.gz

Sorry i did mean sd*

Last edited by ellisgeek; 02-09-2011 at 07:51 PM.
 
Old 02-09-2011, 08:17 PM   #5
ellisgeek
LQ Newbie
 
Registered: Feb 2011
Location: The Intertubz
Distribution: Debian 6.0 Squeeze, Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
Thumbs up SOLVED thanks!

SOLVED i bit the bullet and installed NTFS-3g then mounted using:
Code:
mount -t ntfs-3g /dev/sdb1 /mymounts/data-old -o rw,uid=root,gid=root,nodev,noexec,utf8,fmask=0111,dmask=0000
and it works
DEATH TO THE NTFS MONSTER!!!!
 
  


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
Add/Remove Hidden and ReadOnly attributes from files and directories on vfat filesyst Snigger Linux - Desktop 6 11-11-2015 09:31 AM
[SOLVED] remove directories that only contain .txt and .log files? jmark Linux - Newbie 13 08-09-2010 04:55 AM
Unable to create files named with latin characters in *some* directories in NTFS glalejos Linux - General 2 10-14-2008 05:01 PM
Problem in displaying files and directories with ntfs-3g scorpion77 Slackware 3 08-09-2008 05:45 AM
Mount NTFS so that files are not executable buts directories are nasty_daemon Slackware 6 09-20-2005 02:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:27 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