Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Windows XP is on the C: Drive and I have partitioned part of this drive to run Linux.
In the windows part of the drive I have a folder with all my MP3's in it and I would like to be able to access this folder to listen to my music when I am using Linux.
First, find out what filesystem your C: Drive has been formatted in.
IF it is a NTFS partition (Linux can't recognize NTFS which is what WinXP is most likely running on, but it can recognize FAT32) then you should created another partition in FAT32 and then mount it on Linux.
I recommend using something like PartitionMagic to create the other partition.
Once you have a FAT32 partition, go to a command prompt in Linux and do this:
# mkdir /mnt/<whatever you wanna call your new partition>
# mount -t vfat /dev/hdax /mnt/<whatever the partition is called>
-you don't actually have to type the <>
-the x in hdax stands for whatever number that partition is
then you may wanna edit the file /etc/fstab so Linux could automatically mount the partition on startup. what you'd have to do is simply add the following line to that file:
Actually I think recent kernels can read ntfs quite well (writing is still experimental). You'll only need a vfat fs to transfer data from linux to winxp (but why would you use winxp any more? )
First check this:
mount
You may find your xp disk is already mounted
If not, type this a root :
mkdir /mnt/winxp
mount -r -t ntfs /dev/hda1 /mnt/winxp
ls /mnt/winxp
TIP: make use of shell auto-completion, try for example /m<tab>w<tab>
if it works put this in /etc/fstab:
/dev/hda1 /mnt/winxp ntfs ro,auto,umask=0 0 0
PS: i would suggest a
ln -s /mnt/winxp/<your mp3 directory> /home/<username>/mp3
you can't mount a directory, you always mount a whole filesystem. If you don't actually use a directory, it will never be read, so don't worry about memory.
What you can do is symlinking: ln -s <file> <linkname>
>I did the mounting within root but I can see that user james does not have permissions, how do I allow others permissions.
did you mean you mounted under /root ? if so, don't do it! mount under /mnt/win
if you mean as root user, use mount -o umask=0 ...
I Have tried as you have suggested, could you explain what the -o unmask=0 means.
However, I am still unable to get permission as a "user" to write to the folder/device or any of the subfolders.
I can read (that was the main purpose - so I could play my MP3's whilst using Linux). But I would also like to rip MP3's whilst I am using Linux and put them in the same place.
1) It's strange you can't write. Please send me the output of these commands, so i can further help you:
mount
ls -l /mnt/c
2) FAT filesystem doesn't have the concept of 'owner' or 'permissions', so you must specify what users can/cannot do (to learn more about permissions, use
'man chmod')
This is the relevant part of mount manpage ('man mount')
umask=value
Set the umask (the bitmask of the permissions that are not
present). The default is the umask of the current process. The
value is given in octal.
3) Probably what makes free software great is good to excellent documentation. if you feel courious/have a question about a command, the first thing to try is 'man commadname'. Pressing 'h' while in man pages takes you to viewer help. Take a minute to read the 'searching' section, it's worth it.
HOMEWORK: find the info on umask in muont man page with '/' and 'n' commands
I did my Homework, still not that really sure about umask.
Please find below:
[root@localhost james]# mount -o umask=0 -t vfat /dev/hda1 /mnt/win
[root@localhost james]# ls -l /mnt/win
total 829872
-rwxrwxrwx 1 root root 235683 Feb 3 2002 2002-02Rorepes MOQ2.txt
-rwxrwxrwx 1 root root 298 Dec 3 2002 about
drwxrwxrwx 2 root root 16384 Dec 3 2002 acm
drwxrwxrwx 3 root root 16384 Jul 22 2002 adobeapp
-r-xr-xr-x 1 root root 554 Jun 30 2001 asd.log
drwxrwxrwx 3 root root 16384 Jul 15 2002 ati
drwxrwxrwx 3 root root 16384 Nov 30 22:01 audio
-rwxrwxrwx 1 root root 194 Jun 29 2001 autoexec.bak
-rwxrwxrwx 1 root root 139 May 27 2002 autoexec.bat
-rwxrwxrwx 1 root root 139 May 27 2002 autoexec.cam
-rwxrwxrwx 1 root root 194 Jun 17 2001 autoexec.dos
-rwxrwxrwx 1 root root 0 Nov 28 18:17 Autosafeactive.tmp
-rwxrwxrwx 1 root root 11711 Mar 15 2003 avgun.log
-rwxrwxrwx 1 root root 37658134 Feb 20 2002 back_up.reg
-rwxrwxrwx 1 root root 137 Jul 11 19:51 BcBtRmv.log
-rwxrwxrwx 1 root root 2031 Jul 1 2001 blank.html
-rwxrwxrwx 1 root root 194 Dec 30 2002 boot.bak
-r-xr-xr-x 1 root root 265 Dec 6 13:23 boot.ini
-rwxrwxrwx 1 root root 512 Oct 28 2001 bootsect.dos
drwxrwxrwx 2 root root 16384 Oct 6 2002 btmagic.pq
-rwxrwxrwx 1 root root 484864 Oct 1 2001 Capture001.avi
-rwxrwxrwx 1 root root 484864 Oct 1 2001 Capture002.avi
-rwxrwxrwx 1 root root 484864 Oct 1 2001 Capture003.avi
-rwxrwxrwx 1 root root 510976 Oct 1 2001 Capture004.avi
-rwxrwxrwx 1 root root 510976 Oct 1 2001 Capture005.avi
-rwxrwxrwx 1 root root 510976 Oct 1 2001 Capture006.avi
-rwxrwxrwx 1 root root 484864 Oct 1 2001 Capture.avi
-rwxrwxrwx 1 root root 64 Oct 1 2001 Capture.fcb
dr-xr-xr-x 4 root root 16384 Jul 15 01:17 cmdcons
-r-xr-xr-x 1 root root 237728 Aug 23 2001 cmldr
-rwxrwxrwx 1 root root 486 Jun 23 2001 compatid.txt
-rwxrwxrwx 1 root root 0 Jun 29 2001 config.bak
-rwxrwxrwx 1 root root 0 Jun 17 2001 config.sys
-rwxrwxrwx 1 root root 25292 Nov 29 2000 copying
drwxrwxrwx 2 root root 16384 Nov 29 18:59 Dido
drwxrwxrwx 7 root root 16384 Oct 28 2001 Documents and Settings
drwxrwxrwx 2 root root 16384 Oct 16 2002 download
drwxrwxrwx 2 root root 16384 Nov 29 23:52 Elton John
-rwxrwxrwx 1 root root 30 Mar 8 2000 file_id.diz
drwxrwxrwx 2 root root 16384 Nov 22 2002 found.000
drwxrwxrwx 2 root root 16384 Nov 28 2002 found.001
drwxrwxrwx 2 root root 16384 Dec 25 2002 found.002
drwxrwxrwx 2 root root 16384 Apr 2 2003 found.003
drwxrwxrwx 2 root root 16384 Jul 11 19:00 found.004
drwxrwxrwx 2 root root 16384 Jul 11 19:07 found.005
drwxrwxrwx 2 root root 16384 Jul 11 19:20 found.006
drwxrwxrwx 2 root root 16384 Aug 1 21:53 found.007
-rwxrwxrwx 1 root root 1012 Jun 17 2001 frunlog.txt
-rwxrwxrwx 1 root root 82 Nov 30 22:01 gcal.ini
drwxrwxrwx 2 root root 16384 Dec 3 2002 html
drwxrwxrwx 3 root root 16384 Oct 4 2002 HW Monitor
drwxrwxrwx 3 root root 16384 Sep 10 2001 imsi
-rwxrwxrwx 1 root root 1149 Nov 29 18:27 install.log
-r-xr-xr-x 1 root root 222390 Apr 23 1999 io.sys
-rwxrwxrwx 1 root root 172032 Dec 3 2002 lame_enc.dll
-rwxrwxrwx 1 root root 196608 Dec 3 2002 lame.exe
-rwxrwxrwx 1 root root 707 Dec 19 2000 license
drwxrwxrwx 2 root root 16384 Mar 31 2002 lj631en
drwxrwxrwx 3 root root 16384 Jun 17 2001 Media
drwxrwxrwx 2 root root 16384 Dec 3 2002 misc
-rwxrwxrwx 1 root root 834 Sep 5 00:54 Mp3FE.m3u
-r-xr-xr-x 1 root root 1678 Jun 23 2001 msdos.bak
-r-xr-xr-x 1 root root 1676 Jun 17 2001 msdos.sys
-rwxrwxrwx 1 root root 32 Sep 14 1999 msdsv.syc
dr-xr-xr-x 3 root root 32768 Oct 26 15:14 Music mp3
drwxrwxrwx 2 root root 32768 Mar 31 2002 My Download Files
drwxrwxrwx 3 root root 16384 Mar 23 2003 My Drivers
drwxrwxrwx 2 root root 16384 Jun 17 2001 My PixAround
-r-xr-xr-x 1 root root 45124 Aug 23 2001 ntdetect.com
-r-xr-xr-x 1 root root 222368 Aug 23 2001 ntldr
-rwxrwxrwx 1 root root 52507 Mar 15 2003 OfcDebug.log
drwxrwxrwx 14 root root 16384 Mar 15 2003 OfficeScan NT
drwxrwxrwx 3 root root 16384 Sep 26 22:04 OmegaOne
-rwxrwxrwx 1 root root 805306368 Dec 7 15:30 pagefile.sys
-rwxrwxrwx 1 root root 2959 Jan 25 2003 PCcheck.LOG
-rwxrwxrwx 1 root root 13030 Jan 10 2002 pdoxusrs.net
drwxrwxrwx 8 root root 16384 Aug 9 17:21 Perl
drwxrwxrwx 2 root root 16384 Aug 14 21:34 Playlist
dr-xr-xr-x 157 root root 16384 Feb 11 2002 Program Files
drwxrwxrwx 2 root root 16384 Nov 18 2002 PTabSetup
drwxrwxrwx 2 root root 16384 Aug 14 21:35 Radio Stations
-rwxrwxrwx 1 root root 1801 Jan 19 2002 readme
drwxrwxrwx 6 root root 16384 Oct 28 2001 Recycled
-rwxrwxrwx 1 root root 2308 Oct 5 2001 scandisk.log
drwxrwxrwx 2 root root 16384 Aug 1 2001 scremove
drwxrwxrwx 3 root root 16384 Oct 20 2001 Supra
-rwxrwxrwx 1 root root 111 Jul 24 2001 sys18315.bin
-rwxrwxrwx 1 root root 111 Jul 13 2002 sys43786.bin
drwxrwxrwx 4 root root 16384 Oct 28 2001 System Volume Information
drwxrwxrwx 3 root root 16384 Nov 25 2001 temp
-rwxrwxrwx 1 root root 14952 Oct 18 00:35 test.txt
drwxrwxrwx 2 root root 16384 Sep 29 20:23 Training
drwxrwxrwx 2 root root 16384 Oct 28 2001 undo
-rwxrwxrwx 1 root root 162304 May 24 2001 unwise.exe
drwxrwxrwx 57 root root 16384 Jun 21 2001 unzipped
-rwxrwxrwx 1 root root 25632 Jan 22 2002 usage
drwxrwxrwx 2 root root 16384 Jun 17 2001 VIAhm
drwxrwxrwx 2 root root 16384 Aug 25 2001 Video
-rwxrwxrwx 1 root root 49152 Jun 17 2001 videorom.bin
-rwxrwxrwx 1 root root 13 Jul 1 2001 vxsystem.dat
drwxrwxrwx 2 root root 16384 Jun 9 2002 Webdnews
drwxrwxrwx 3 root root 16384 Sep 5 2001 which
drwxrwxrwx 136 root root 65536 Jun 17 2001 windows
-rwxrwxrwx 1 root root 65536 Dec 19 2002 WINDOWSCAPTURE.AVI
drwxrwxrwx 6 root root 16384 Dec 1 2002 Windows CE Tools
-rwxrwxrwx 1 root root 63 Oct 1 2001 WINDOWSWinHlp32.BMK
-r-xr-xr-x 1 root root 10122 Oct 28 2001 winlfn.ini
-rwxrwxrwx 1 root root 10079 Oct 26 14:15 winzip.log
drwxrwxrwx 2 root root 16384 Oct 28 2001 WUTemp
-rwxrwxrwx 1 root root 2005 Nov 15 2002 ZinioInstall.txt
[root@localhost james]#
For information the directory I would like write permission is "Music mp3"
I notice that in RH7 there was a program called linuxconf that looked as if it would help me configure the permissions but it does not appear to be available in RH9
Still awake
Ok, got the problem: that dir has the readonly bit set (from win, i suppose)
as root, type:
chmod +w /mnt/win/Music\ mp3
tip: get used to shell auto-completion: /m<tab>w<tab>Mu<tab>
note: it's not common for unix files to include spaces, it may confuse badly-written shell scripts. Consider replacing the space with an underscore
(unix command for renaming is mv (for move))
Have you tryed again writing to the fs? 777 is exacly what you need!
the reason why you got the error message was actually your defaul umask (that a property of the shell, not of the filesystem) is probably 022, so chmod +w is interpreted as 'u+w'. To override explicitly type 'chmod a+w' or use numerical permissions like 777. Refer to chmod man page.
Last note: the executable flag for directories means stands for the ability to make it the current dir. A 666 permission (rw-rw-rw-), besides being unachevable on fat, makes little sense.
> Not sure what you mean by Autocomplete?
if you press <tab> your shell will complete the filename you're typing up to the first ambiguity. When there's no unique next char, it will beep. Pressing it again will list all the possible completions.
Originally posted by Foggy
[root@localhost james]# chmod +w /mnt/win/Music\ mp3
chmod: changing permissions of `/mnt/win/Music mp3' (requested: 0755, actual: 0777): Operation not permitted
[root@localhost james]#
This is really strange for a fat32 drive. Have you used any 3rd party encryption utils in windows that may be causing problems? You could also try creating another directory in Windows (or better still from Linux: mkdir /mnt/win/musicfiles as a normal user) and moving all your mp3's to there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.