Tiny Core Linux

General TC => General TC Talk => Topic started by: manit123 on February 23, 2013, 11:46:35 PM

Title: automount ntfs patition on startup
Post by: manit123 on February 23, 2013, 11:46:35 PM
hi , i am using tiny core 4.7.3.
I added to /opt/bootlocal.sh
mount /dev/sdb1 /mnt/sdb1
I found that the mounted ntfs partition has option ro & also belongs to root:root
Quote
/dev/sdb1 on /mnt/sdb1 type ntfs (ro,relatime,uid=0,gid=0,fmask=0177,dmask=077,nls=iso8859-1,errors=continue,mft_zone_multiplier=1)
dr-x------ 1 root root 32.0k feb 17 13:56 sdb1/

Thus I am not able to access mountpoint as normal user , also cannot edit files on it as root.
What should I do ?
Title: Re: automount ntfs patition on startup
Post by: gerald_clark on February 24, 2013, 01:05:41 AM
You need to install ntfs-3g and read the info file.
You might also want ntfsprogs.
Title: Re: automount ntfs patition on startup
Post by: tinypoodle on February 24, 2013, 02:54:08 AM
Code: [Select]
mount -o 'uid=1001,gid=50' /mnt/sda2works for me wrt ownership, though that's with vfat.
Title: Re: automount ntfs patition on startup
Post by: manit123 on February 24, 2013, 06:58:37 AM
already ntgs-3g & ntfsprogs are installed on boot
Quote
df | grep -i ntfs
/dev/loop11 512.0K 512.0K 0 100% /tmp/tcloop/ntfs-3g
/dev/loop12 464.0K 464.0K 0 100% /tmp/tcloop/ntfsprogs
Title: Re: automount ntfs patition on startup
Post by: manit123 on February 24, 2013, 07:40:19 AM
i added following to bootlocal.sh (inspired by tinypoodle & the way mountool does)
Quote
mount -o 'rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize-4096' /mnt/sdb1
Title: Re: automount ntfs patition on startup
Post by: gerald_clark on February 24, 2013, 10:17:43 AM
You did not read the info file.  It tells you how to mount ntfs3g.
Title: Re: automount ntfs patition on startup
Post by: Rich on February 24, 2013, 10:55:16 AM
Hi gerald_clark
I'm not sure you even need ntfs-3g. I have ntfsprogs installed since gparted needs it for NTFS anyway, and I
can mount and access drives:
Code: [Select]
tc@box:~$ sudo ntfsmount /dev/sdb6 /mnt/sdb6
tc@box:~$ cat /etc/mtab | grep sdb6
/dev/sdb6 /mnt/sdb6 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
tc@box:~$ cp ledcontrol.c /mnt/sdb6
tc@box:~$ ls -l /mnt/sdb6
total 4
-rw-rw-rw- 1 root root 3114 Feb 24 10:45 ledcontrol.c
tc@box:~$ rm /mnt/sdb6/ledcontrol.c
rm: remove regular file `/mnt/sdb6/ledcontrol.c'? y
tc@box:~$ sudo umount /mnt/sdb6
Title: Re: automount ntfs patition on startup
Post by: gerald_clark on February 24, 2013, 10:59:24 AM
You don't need ntfs-3g unless you want to write, which was the original complaint.
Title: Re: automount ntfs patition on startup
Post by: Rich on February 24, 2013, 11:28:21 AM
Hi gerald_clark
But I was able to write. My previous posts shows a file being copied to sdb6 (NTFS). Mtab shows it as rw.
Title: Re: automount ntfs patition on startup
Post by: gerald_clark on February 24, 2013, 11:41:44 AM
/dev/sdb6 /mnt/sdb6 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0

That fuseblk leads me to believe it is mounted ntfs-3g.
Title: Re: automount ntfs patition on startup
Post by: Rich on February 24, 2013, 11:50:25 AM
Hi gerald_clark
I don't have  ntfs-3g.tcz  or  ntfs-3g-adv.tcz  installed, only  ntfsprogs.tcz.
Title: Re: automount ntfs patition on startup
Post by: Lee on February 24, 2013, 05:33:22 PM
Rich - you wouldn't happen to be loading ntfs3g.gz along with core.gz, would you?  That would bring ntfs3g in  - I think even if you specified "base".
Title: Re: automount ntfs patition on startup
Post by: Rich on February 24, 2013, 08:46:57 PM
Hi Lee
No, this is on a plain vanilla TC4.1 system.
Title: Re: automount ntfs patition on startup
Post by: althalus on February 24, 2013, 10:10:01 PM
Hi gerald_clark
I'm not sure you even need ntfs-3g. I have ntfsprogs installed since gparted needs it for NTFS anyway, and I
can mount and access drives:
Code: [Select]
tc@box:~$ sudo ntfsmount /dev/sdb6 /mnt/sdb6
tc@box:~$ cat /etc/mtab | grep sdb6
/dev/sdb6 /mnt/sdb6 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
tc@box:~$ cp ledcontrol.c /mnt/sdb6
tc@box:~$ ls -l /mnt/sdb6
total 4
-rw-rw-rw- 1 root root 3114 Feb 24 10:45 ledcontrol.c
tc@box:~$ rm /mnt/sdb6/ledcontrol.c
rm: remove regular file `/mnt/sdb6/ledcontrol.c'? y
tc@box:~$ sudo umount /mnt/sdb6

If memory serves, you are correct up to a point. Fairly sure that if the NTFS disk wasn't properly unmounted (Say you forgot to safely remove it, your you crashed windows), you need ntfs-3g or ntfs-tools to successfully mount RW
Title: Re: automount ntfs patition on startup
Post by: Rich on February 25, 2013, 01:07:36 AM
Hi althalus
Google didn't return any packages called ntfs-tools. Looking at the file names, except for ntfsmount, ntfs-3g appears
to contain all the programs provided by ntfsprog.
Title: Re: automount ntfs patition on startup
Post by: tinypoodle on February 25, 2013, 10:31:10 AM
Hi althalus
Google didn't return any packages called ntfs-tools. Looking at the file names, except for ntfsmount, ntfs-3g appears
to contain all the programs provided by ntfsprog.
ntfs-3g.tcz is based on the merged release of ntfsprogs and NTFS-3G.
For details see here:
http://www.tuxera.com/open-source/release-ntfs-3g-ntfsprogs-2011-4-12/
Title: Re: automount ntfs patition on startup
Post by: althalus on February 25, 2013, 03:49:51 PM
Hi althalus
Google didn't return any packages called ntfs-tools. Looking at the file names, except for ntfsmount, ntfs-3g appears
to contain all the programs provided by ntfsprog.
Sorry, typo on my part. I meant ntfsprog