Solved

Sharing files between windows/linux

Posted on 2004-09-03
18
370 Views
Last Modified: 2010-04-20
I have WindowsXP and RedHat Linux 9 installed on the same machine, with two 80GB HD drives. There are several Windows partitions on the two hard disks (FAT32 and NTFS), and I would like to access them from Linux (only FAT32 is possible I suppose). How can this be done?
0
Comment
Question by:thanasis57
  • 8
  • 6
  • 2
  • +2
18 Comments
 

Assisted Solution

by:JoelCant
JoelCant earned 50 total points
ID: 11973501
mount -t vfat /dev/hdX /mnt/X

where /dev/hdx is the drive you want to mount, hda1 is the first partition on the primary ide channel master drive, hdb1 is the first partition on the primary ide channel slave drive, and so on. You can mount ntfs drives (mount -t ntfs), but only read from them with 2.4.x kernels, and partially write with 2.6.x kernels. /mnt/X is where you want to mount it (doesnthave to be in /mnt, but for tidyness sake thats where most people put it), rember you need to make the directoryyou want to maount the drive to eg;

mkdir /mnt/windows
mount -t vfat /dev/hda1 /mnt/windows

Hope this helps

Joel

0
 
LVL 6

Assisted Solution

by:knollbert
knollbert earned 25 total points
ID: 11974249
check out

http://freshmeat.net/projects/captive/

It'll change your fstab file
create folders to place it mounted partitions in
And can Read/write safely  
Only requirements are having an internet connection so it can grab
Xp SP1 to get windows dll's
0
 
LVL 6

Expert Comment

by:knollbert
ID: 11974254
And can Read/write NTFS safely  
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 1

Author Comment

by:thanasis57
ID: 11979562
Thank you Joel

A) I name one partition "data" . It is the first partition on the second HD (as they appear in Partition Magic). I created the directory /mnt/data and gave the command:

mount -t vfat /dev/hdb1 /mnt/data

The response was:
mount: wrong fs type, bad option, bad superblock on /dev/hdb1,
       or too many mounted file systems
       (aren't you trying to mount an extended partition,
       instead of some logical partition inside?)

B)The second partition on this HD is named " software". After creating /mnt/software, and giving the command:
mount -t vfat /dev/hdb2 /mnt/software

the response was
mount: /dev/hdb2 already mounted or /mnt/software busy
mount: according to mtab, /dev/hdb2 is mounted on /home

However,  there is no such directory in /home

--To knollbert
The problem is that I should reformat my drives, which are already FAT32, and I would like to avoid that.

Thanks in advance
0
 
LVL 1

Assisted Solution

by:gn0
gn0 earned 25 total points
ID: 11982861
thanasis57
it seems that you are mounting the wrong partitions - post to output of the following commands and we would be better able to help you .....

fdisk -l
mount

(NB last letter of the first command is common "L")
the first command will list all partitions on all you drives.... the second will give the mounted partitions.....
also tell us the size of your 'data' and 'software' directory....

Nav.
0
 
LVL 1

Author Comment

by:thanasis57
ID: 11983187
Thanks gn0:

fdisk -l or -L:
bash: fdisk: command not found

mount
/dev/hda3 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hdb2 on /home type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/hdb3 on /windows type vfat (rw,noexec,nosuid,nodev)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

It seems that I have not understood how partitions are named according to Linux standard, so I just give them in order of appearence in Partition Magic:

DIsk1
1) C: 14000MB, NTFS
2) F: 20000MB, NTFS
3) G: 20000MB, NTFS
4) Linux partition Ext2 13000MB
5) swap

Disk2
1) H: (data) 20000MB, FAT32
2) I: (software) 20000MB, FAT32
3) Linux partition Ext2 10000MB
4) J: (mp3) 10000MB, FAT32. This partition only is accessible as /windows

Do you also need to know which partitions  are logical or primary?

Thanks
0
 
LVL 1

Author Comment

by:thanasis57
ID: 11983229
Here is a complete list:

Disk1
1) C: 14000MB, NTFS, primary

2) F: 20000MB, NTFS, logical |----->
3) G: 16000MB, NTFS. logical |----->In the same axtended partition

4) Linux partition Ext2 13000MB, primary
5) swap, primary


Disk2
1) H: (data) 20000MB, FAT32, logical      |------>
2) I: (software) 20000MB, FAT32, logical |------>In the same extended partition

3) Linux partition Ext2 10000MB, primary
4) J: (mp3) 10000MB, FAT32, primary. This partition only is accessible from Linux as /windows
0
 
LVL 10

Accepted Solution

by:
Luxana earned 150 total points
ID: 11983359
thanasis57

are you sure that /dev/hdb1 is the correct partition what youwant to mount? As I can see you do not have fdisk so please try # cfdisk and print out the partitions tables from both /dev/hda and /dev/hdb and paste it here for us please just to make thinks clear.

as root:

# cfdisk /hdb  

then choose print table the aoutput schould look like this :

-----------------------------------------------------
Partition Table for /dev/hda

         ---Starting---      ----Ending----    Start     Number of
 # Flags Head Sect Cyl   ID  Head Sect Cyl     Sector    Sectors
-- ----- ---- ---- ---- ---- ---- ---- ---- ----------- -----------
 1  0x00    1    1    0 0x12  254   63  254          63     4096512
 2  0x00    0    1  255 0x07  254   63 1023     4096575    20482875
 3  0x80  254   63 1023 0x83  254   63 1023    24579450     6843690
 4  0x00  254   63 1023 0x05  254   63 1023    31423140    46717020
 5  0x00  254   63 1023 0x0B  254   63 1023          63    44917677
 6  0x00  254   63 1023 0x82  254   63 1023          63      497952
 7  0x00  254   63 1023 0x0B  254   63 1023          63     1301202


or you just check partions and filesystems what you have  and make sure that /dev/hdb1 is not extended partition.

luxana
0
 
LVL 10

Expert Comment

by:Luxana
ID: 11983387
correction

# cfdisk /dev/hdb  not #cfdisk /hdb :-)

if the /dev/hdb1 is extended partition then justa heve a look for the correct partition what you need to mount and also use appropriate filesystem option iny mount command.

0
 
LVL 1

Author Comment

by:thanasis57
ID: 11983907
Thank you luxana,

I tried what you told me, but the command:
# cfdisk /dev/hdb
gave no result.

I also tried appending the output:
# cfdisk /dev/hdb > hdb.txt
but no txt file was created.

When I tried:
cfdisk /dev/hdb
the command was not found.
0
 
LVL 1

Author Comment

by:thanasis57
ID: 11983941
I believe that the correspondence of partitions between window/linux must be the following:

Part. no     windows letter      linux    filesystem     mount point

Disk1
1)                       C:              hda1      ntfs
2),3)               F:, G:             hda2      ntfs
                (two logical partitions
                in the same extended
                    partition)
4)                       -                hda3      linux ext2         /
5)                       -                hda4      swap

Disk2
1),2)                    H:,I:          hdb1       FAT32
                (two logical partitions
                in the same extended
                    partition)
3)                         -              hdb2      linux ext2         /home
4)                         J:             hdb3      FAT32             /windows

Sorry for the presentation, but I am still novice at Linux
0
 
LVL 10

Expert Comment

by:Luxana
ID: 11983993
thanasis57

Is there any chance that you can show as you real partition table like linux output from # fdsik or from # cfdisk?

Because as I know that in linux logical partitions starts with number 5 your first logical partition must starts hdb5 ( if it is logical !) . Your extendet partition can starts hdb1. Here is example:

/dev/hdb1 (primary)
/dev/hdb2 (extended)->think of it as primary but you can't  mount it it is just a container for logical p.
/dev/hdb5 (logical)
/dev/hdb6 (logical)

So is it not the /dev/hdb5 first logical partition what we are loking for?

# cfdisk  ( with no options this should give you default /dev/hda primary master)
# cfdisk /dev/hdb ( this is for secondary master )

I'm using debian but in redhat cfdisk should be same check man pages for cfdisk just ina case.

let us know how you doing...

luxana
0
 
LVL 1

Author Comment

by:thanasis57
ID: 11984027
Luxana,

# cfdisk doesn't work in RedHat, and there is no such man entry. Maybe you know the corresponding command?

Also, you need to know that I created my partitions for windows first, and that the first partitions in the disk are logical. Maybe that might cause a problem?
0
 
LVL 10

Expert Comment

by:Luxana
ID: 11984059
what you get from this:

# which cfdisk  

;for manul page for cfdisk
# man cfdisk

did you try mount /dev/hdb5 ?

try mount /dev/hdb5

# mount /dev/hdb5 -t vfat /mnt/your_folder  
0
 
LVL 10

Expert Comment

by:Luxana
ID: 11984077
also look at my partitions table for example:

-----------------------------------------------------
Partition Table for /dev/hda

         ---Starting---      ----Ending----    Start     Number of
 # Flags Head Sect Cyl   ID  Head Sect Cyl     Sector    Sectors
-- ----- ---- ---- ---- ---- ---- ---- ---- ----------- -----------
 1  0x00    1    1    0 0x12  254   63  254          63     4096512 -  compaq diagnostic (primary)
 2  0x00    0    1  255 0x07  254   63 1023     4096575    20482875 - NTFS (primary)
 3  0x80  254   63 1023 0x83  254   63 1023    24579450     6843690 - linux native (primary)
 4  0x00  254   63 1023 0x05  254   63 1023    31423140    46717020 - extended
here starts logical partitions:
 5  0x00  254   63 1023 0x0B  254   63 1023          63    44917677 - W95 FAT32 (logical)
 6  0x00  254   63 1023 0x82  254   63 1023          63      497952 - linux swap (logical)
 7  0x00  254   63 1023 0x0B  254   63 1023          63     1301202 - W95 FAT32 (logical)
0
 
LVL 1

Author Comment

by:thanasis57
ID: 11985592
A friend came over and halped me out.

-With
whereis fdisk
we found that it is in /sbin/fdisk

-With
/sbin/fdisk /dev/hda, or hdb
we obtained the partition tables and saw which ones we should mount

-With
mount /dev/hdbx /mnt/filename
we mounted the desired partition to the desire mountpoint

-Finally we modified /etc/fstab so that the partitions are mounted at startup, by adding the lines:
/dev/hdbx         /mnt/filename               vfat            defaults,user   0  0

Thanks for the effort everyone. I will split the points to JoelCant, knollbert, gn0 and mainly to Luxana.
0
 
LVL 10

Expert Comment

by:Luxana
ID: 11986476
thanasis57 ,

I'm just curious but what partition number was it we were looking for? /dev/hdb?    

good luck
0
 
LVL 1

Author Comment

by:thanasis57
ID: 11989796
It was pertitions hdb3, hdb5 and hdb6 that I wanted to mount
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question