Link to home
Start Free TrialLog in
Avatar of AIX25
AIX25Flag for United States of America

asked on

AIX - How to mount and encrypt data on a USB

What is the correct method to discover and mount a USB stick on a server? Also, how to encrypt the data that I will be transferring over to the USB stick on an AIX server?
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AIX25

ASKER

Please provide an example as how I would encrypt and decrypt file1, file2, file3, directory1, and directory2 under /usr_mnt? Would tar up the whole directory and encrypt that?? Also, how do I NFS mount /usr_mnt to another server? Is that possible to NFS mount a USB FS?

servername:/usb_mnt> df -g |grep usb
/dev/usbms0      465.76    465.19    1%        3     1% /usb_mnt
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AIX25

ASKER

After I tar'ed and encrypted the directories. I unmount the USB, and wanted to remount the USB to verify all the data was still there, so I followed your steps again on mounting a USB, and there was no data on the USB. Does it get deleted when I remount the USB, using the method you listed earlier?? How do I view the contact of the USB, without deleting it?
As long as you just issue the "umount" and "mount" commands you should be fine.
These commands don't touch the content of the device.

Of course you should not reissue the "mkfs" command. This will indeed destroy all data.

Btw., are you sure that the data have successfully been placed on the USB device before?
Avatar of AIX25

ASKER

I'm sure the data have successfully place on the USB before unmount.
server:/usb_mnt> ls -l
total 37487336
-rw-r--r--    1 root     system   7105531936 Aug 28 16:34 dir1.enc.tar
-rw-r--r--    1 root     system   2690367520 Aug 28 16:52 dir2.enc.tar
-rw-r--r--    1 root     system   5690830880 Aug 28 16:41 dir3.enc.tar
-rw-r--r--    1 root     system   3705602080 Aug 28 16:48 dir4.enc.tar

The USB unmounts fine, but when I go to remount it..it gives me the error below??

server:/> mount /usb _mnt
mount: 0506-334 /usb_mnt is not a known file system.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AIX25

ASKER

Here is what I get:

server:/> mkfs -V jfs2 -o ea=v2 /dev/usbms0
mkfs: destroy /dev/usbms0 (yes)? yes
File system created successfully.
488371472 kilobytes total disk space.
Device /dev/usbms0:
  Standard empty filesystem
  Size:           976742944 512-byte (DEVBLKSIZE) blocks
server:/> mkdir /usb_mnt
server:/> mount -o log=NULL /dev/usbms0 /usb_mnt
mount: 0506-323 Cannot get information about log device NULL.
server:/>

Why can't I mount it?
Don't you have AIX 6.1 or 7.1? I always assumed so.

AIX 5.x doesn't have the mount option "log=NULL"

In order to mount the device on 5.3 you must create the FS on the originating system (whichever AIX version) with

mkfs -o log=INLINE,ea=v2 -V jfs2 /dev/usbms0

You will be asked "logform: Format inline log for  <y>?" Answer "y".

Mount it without "-o log=NULL" then, regardless of the AIX version.
Use "-o log=INLINE" instead.

mount -o log=INLINE /dev/usbms0 /usb_mnt

I think you're aware that you need the mkfs command only once?
Issuing it a second time will of course destroy your data!

So after umounting it and taking it to another box just plug the device in, issue "cfgmgr"
and the "mkdir" and "mount" commands, not mkfs!
Avatar of AIX25

ASKER

server:/> oslevel -s
6100-07-03-1207
>> mount: 0506-323 Cannot get information about log device NULL. <<

is definitely an AIX 5.3 message. Are you sure you saw it on the same machine as the above oslevel output?

If so, I must admit that I'm out.
Avatar of AIX25

ASKER

What is the correct process with AIX 6.1??
The one I described initially.

And please remember to issue mkfs only once. Subsequent mkfs commands will destroy all data on the device.
Avatar of AIX25

ASKER

Yes, I'm sure that the oslevel was 6.1 on the server. When I was working on this yesterday, I used the 5.3 method, because NULL was not working. Was that why my USB data was not saving correctly, with the unmount and mount?
umount or mount do not destroy data. Only mkfs does.
Avatar of AIX25

ASKER

Then why can't I remount it?
What do you mean, you can't?

Because of the log=NULL error?

So go back to your source system, create the filesystem using the log=INLINE method, mount it using the log=INLINE method, then put your data on the stick, umount it, go to your target system and mount it using the log=INLINE version.

The INLINE method works on AIX 5.3, 6.1 and 7.1!
Avatar of AIX25

ASKER

Here are the steps I ran:

cfgmgr

mkfs -olog=INLINE,ea=v2 -Vjfs2 /dev/usbms0

mkdir /usb_mnt

mount -V jfs2 -o log=/dev/usbms0 /dev/usbms0 /usb_mnt

server:/> df -g |grep usb
/dev/usbms0      465.76    459.44    2%        8     1% /usb_mnt

Then I tar'ed and encrypted all the directories needed.

Also ran, server:/> lsfs |grep usb . Nothing shows up.

THen I ran, unmount /usb_mnt.

What will me the mount command?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AIX25

ASKER

It worked! I was not mounting it with the INLINE mount command! I mounted it with log=INLINE...and that did it!!!