Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cifs and Samba with Power PMAC
#1
We plan to write data capture files to an SD card.... and then shift
them to the PC via samba or ftp. Do you have any recommendations as to which is better? Does samba work on a default installation or do we have to enable it?
Samba is not used anymore and has been replaced by cifs which is in the installtion. Since cifs replaced samba all the samba still work. To use cifs all you have to do is mount the network drive. For example

root@10.34.9.236:/opt/ppmac# mount -t cifs -o username=nick,password=foobar //cpu-nickw/shared /media/shared

OR

root@10.34.9.236:/opt/ppmac# mount -t smbfs -o username=nick,password=foobar //cpu-nickw/shared /media/shared

Then navigate to the folder /media/shared on the PowerPMAC and you will be talking to the network share of your PC

//cpu-nickw/shared is the UNC path to the Windows PC and /media/shared is the Linux PowerPMAC drive folder where you see the PC data. You could always write directly to the PC with cifs (samba). Or you could write to the SD card then transfer the files over cifs (samba). I don't think it will matter much. It is something you will have to try yourself.

To mount the SD card

root@10.34.9.236:/opt/ppmac# mount -t vfat /dev/sdb1 /media/sd

The SD card will be read at /media/sd.

On the 440 prototype boards we only have the cifs (samba) client and this means you can share the PC data with the Power PMAC. On the 460 released boards we have both client and server although we believe the client to be most useful.
Reply
#2
I was only able to get the CIFS mount to work by specifying the IP address of my server:

mount -t cifs -o username=uuuuuu,password=pppppp,domain=dddddd //xxx.xxx.xxx.xxx/sharename /media/share

If I replace the xxx.xxx.xxx.xxx with the server name, I get a return code of -22. Online searches suggest that I need to have /sbin/mount.cifs. There exists a /sbin/mount.nfs, but no /sbin/mount.cifs. Can you help?
Reply
#3
Do you have DNS set up properly? You should be able to test this by pinging your remote computer by name:

e.g.

ping SomeComputer

instead of

ping 192.168.0.1

KEJR
Reply
#4
Yes. I can ping the server by name from the Power PMAC and it is properly resolved by our DNS.

Note that all of the similar reports on the Internet for other versions of Linux point toward the /sbin/mount.cifs requirement.

Reply
#5
What you need to do is get the smbfs update. To do this follow the instructions in this thread http://forums.deltatau.com/showthread.ph...ght=resolv

Once you get the PPmac talking to the web, which you can check by ping http://www.yahoo.com then the update to:
apt-get update
apt-get install smbfs
Reply
#6
Brad,

Our Power PMAC is set up on a secured network. As it is presently configured, the request would need to go through a proxy server to get to the Internet, and that server requires authentication. How do I set that up?

Mike
Reply
#7
Then you need to use another PC and Download the powerpc package of smbfs from

http://packages.debian.org/lenny/smbfs

Then you can ftp it to ppmac and From linux execute

dpkg -i smbfs_xxxxx_powerpc.deb

What you will find is that it probably will ask for other packages so you might need to go back and forth a bit.
Reply
#8
(01-07-2011, 12:35 PM)bradp Wrote: What you need to do is get the smbfs update. To do this follow the instructions in this thread http://forums.deltatau.com/showthread.ph...ght=resolv

Once you get the PPmac talking to the web, which you can check by ping http://www.yahoo.com then the update to:
apt-get update
apt-get install smbfs

Brad,

I was able to resolve the proxy problems by specifying my proxy via the http_proxy environment variable. The following commands allowed me to install the mount.smbfs and mount.cifs files.

mount -o remount,rw /
env http_proxy=http://username:password@proxyserver:proxyport/ apt-get install smbfs
mount -o remount,ro /

This then enabled me to specify the server name rather than its IP address on the mount -t cifs command line.

Problem resolved.
Reply
#9
Brad,

When using the apt-get install method to install packages, I have noticed that some files get installed in the /var and /etc folders. If you test the installed application immediately, it usually works, but if you reboot the Power PMAC, all files and directories that were created in /var or /etc are lost because of the volatility of those folders. I have been using rsync -av to sync up /etc and /var with /.readonly/etc and /.readonly/var. Is that the procedure that you recommend, or is there another procedure which should be used?

P.S. Note that I needed to apt-get install rsync since it was not installed by default.
Reply
#10
Sounds fine to me. This is the issue we tried to cover in points 4 and 5 of the post http://forums.deltatau.com/showthread.ph...ght=resolv
Reply
#11
(01-14-2011, 04:28 PM)michaelthompson Wrote: When using the apt-get install method to install packages, I have noticed that some files get installed in the /var and /etc folders.

Micheal,

This has been covered in other posts, but I pasted in my own notes on installing debian packages with the PPMAC. There are a few extra manual steps before and after you do apt-get:

***
Notes On Debian Package Installation

The root filesystem “/” is mounted readonly so you have to mount that as read-write while installing packages. In addition the “/etc” folder is mounted as a virtual ram disk. Anything that normally writes to /etc (such as apt-get…) will end up putting information in “/.readonly/etc-tmpfs-mirror”. So after installing packages anything that gets written to “/.readonly/etc-tmpfs-mirror” must then get copied to “/.readonly/etc”. The contents of “/.readonly/etc” gets copied to the virtual “/etc” upon a reboot. Here is an example of installing emacs with gtk support:

# mount –o remount,rw /
# apt-get install emacs22-gtk

(apt-get processes as normal, answer typical prompts…)

# cd /.readonly/etc-tmpfs-mirror
# cp –a * ../etc
# mount -o remount,ro /


After doing this procedure you should have everything back at reboot time.

KEJR
Reply
#12
KEJR,

Thanks for the post. I have found that some packages touch /var in addition to /etc so it too needs to be copied in some cases. After the install, I use diff to compare /var to /.readonly/var and likewise with /etc.

Regarding your example, what is the difference (if any) between copying from the /.readonly/etc-tempfs-mirror or simply copying from /etc. Aren't they by definition guaranteed to be the same?
Reply
#13
Henry Bausley described how the readonly filesystem works better than I can here:

http://forums.deltatau.com/showthread.ph...e=threaded

Are you sure that the applications that touch /var are not just doing some logging and stuff? The reason I ask is that I would think it bad practice to put install files in /var, but I am not a linux guru.

My point is that you shouldn't have to use rsync , the procedure I listed worked for me in several cases and was recommended by Delta Tau on various posts here on this forum. If there are packages that install [valid] things to /var I would like to know about it and modify my procedure.

What files got added/modified to /var?

KEJR


Reply
#14
Samba created a directory where its log files go. The directory is apparently not created by Samba processes if it does not exist. Moreover, as I recall, the daemons didn't start up because of the fact that the logging directory didn't exist. So far, I think it is the only package that had this problem, but it made me aware of the concern.

As of now, I have only installed a few packages:

CIFS
Samba
RSync
NTP
Reply
#15
I've installed emacs-gtk, rlogin, and some other utilities. So far no issues with /var. That is crap that they don't create a folder in code. Maybe we should write a patch ;)

There are /.readonly/var and a /.readonly/var-tmpfs-mirror directories, so one would guess that it is handled exactly like the /etc filesystem.

So in theory creating the log directory in /.readonly/var in addition to the instructions in my previous post would do it.

I'd be hesitant to copy all files in the /var folder to the read only equivalent only because you don't want to save every log file generated since startup to your flash drive.

While this is a pain in the butt I really have to hand it to Delta Tau for giving us a read only filesystem. I really like how we can just pull the plug on the PPMAC and not worry about "shutting it down".

KEJR
Reply
#16
(01-18-2011, 09:19 AM)KEJR Wrote: That is crap that they don't create a folder in code.

Agreed. And because it's the log directory, there isn't any log of the failure. I can't remember how I figured it out. I think I started the daemons manually and saw the message about not being able to open the log file spit out to the console.

(01-18-2011, 09:19 AM)KEJR Wrote: So in theory creating the log directory in /.readonly/var in addition to the instructions in my previous post would do it.

The directory was /var/log/samba.

(01-18-2011, 09:19 AM)KEJR Wrote: I'd be hesitant to copy all files in the /var folder to the read only equivalent only because you don't want to save every log file generated since startup to your flash drive.

I was hesitant for that very reason and rebooted right before my install. I also did a diff before syncing.

(01-18-2011, 09:19 AM)KEJR Wrote: While this is a pain in the butt I really have to hand it to Delta Tau for giving us a read only filesystem. I really like how we can just pull the plug on the PPMAC and not worry about "shutting it down".

It is a little extra burden during installs, but the benefits (known image plus fewer writes against the flash memory) are worth it.

We just received our Power PMAC in Dec. 2010 and we really only started working with it after the new year. So we are still very early in the ramp-up. However, we've done some pretty neat stuff with it already and can already see what a powerful platform this is going to be for us.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)