LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Multiple Distros - One Data Partition - External Drive (https://www.linuxquestions.org/questions/linux-general-1/multiple-distros-one-data-partition-external-drive-800832/)

adam.ec 04-08-2010 01:01 PM

Multiple Distros - One Data Partition - External Drive
 
Hi guys,

I've got an external hard drive with one large data partition on it. I also have four computers to connect it to (individually, not at the same time). Three machines are running Slackware and one is running Ubuntu 9.10. I need to be able to just plug the drive into whichever machine, mount it (preferably to the same location each time) and not have to worry about user permissions and such. Do I just chmod 777 all the files and folders or is there a better method for different 'users' to access the same partition? And how about mounting to the same location each time?

Now the second part of my question I'm pretty sure I'm not able to do but just in case..... is there any way to encrypt the information safely and make it compatible with a Windows XP machine?

Thanks for any help on the first part, additionally congratulations if you have a solution for the second.

rskaret 04-08-2010 04:00 PM

Hi,

The permissions are only important if the file system on the disk is a "linux" file system like
ext3 reiser ..etc. If it is a FAT or NTFS file system then the permission is nothing to worry about.

The mount point where you mount the disk has to have read/write permission for all users if you access it
from your own user.

If it is a linux file system on the disk then the file permissions are stored with the user id as a number.
You should then make sure you have the same number for the same user on all machines.
The user number can be found in the /etc/passwd file.

My own entry for my "ras" user looks like this on openSuSE 10.3:
ras@f16:~> less /etc/passwd

ras:x:1000:100:Firstname Lastname:/home/ras:/bin/bash

Number 1000 is my user number.

For mounting of the disk to same place each time I would make a directory like this on all machines:
(as root)

mkdir /data
chmod 777 /data

To manually mount the disk to this directory you need to use the mount command.
The disk can be found with dmesg after you connect it.

Here is an entry from my dmesg after I connect an USB disk:
ras@f16:~> dmesg
USB Mass Storage support registered.
scsi 2:0:0:0: Direct-Access SanDisk SanDisk Cruzer 8.02 PQ: 0 ANSI: 0 CCS
sd 2:0:0:0: [sdb] Attached SCSI removable disk
sd 2:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete
sd 2:0:0:0: [sdb] 31797247 512-byte hardware sectors (16280 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 45 00 00 08
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] 31797247 512-byte hardware sectors (16280 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 45 00 00 08
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1

I can the mount the disk like this

mount /dev/sdb1 /data


You can make an entry in the /etc/fstab file for the disk to make it mount a boot up. If the
disk is not connected at boot it will have trouble at fsck for a nonexistent disk.


Hope this helps

/RAS

saikee 04-09-2010 02:44 AM

For reading/writing Ext2/3 partitions in Xp try ext2ifs free driver.

adam.ec 04-09-2010 09:02 AM

Great responses guys thank you, and it's all sorted now. Hope you don't mind if I forward your suggestions on to one of my websites to help others?

Scarletdown 04-09-2010 08:27 PM

This may be a bit more info than you want, but I would also suggest getting a NAS drive (hard drive that hooks directly to a network switch). Then any system that is setup to access samba shares can access it as if accessing any other system's shares. And also, you would then be able to connect that external drive to the NAS drive via USB and access it as yet another share without having to move it from computer to computer.


All times are GMT -5. The time now is 09:00 AM.