Saving to usb

Greetings.

I am trying to save a file to a usb from solaris 10.

If I do rmformat, I see my usb, but can't find a location to tell things to save to or figure out how to save/view the files on the disk.

Any help/thoughts/etc would be appreciated.

Thanks!

~K

What filesystem is the drive formatted to? Solaris probably can't understand NTFS.

Yup. Didn't think of that.

Am i wrong in thinking that once it recognizes the device, a folder should be listed where I can move files to?

There was a thread on this but I can't find it. I think so but aren't 100% sure. Make sure it's FAT, then try again, and post what happens...

It depends on whether you are purely backing up to USB (ie, a Solaris filesystem on the USB is what you want) or you want to move files to a Windows filesystem format on the USB for transportation to another (Windows) system.

For a Solaris filesystem the basic steps are:-

 
rmformat -l

To see whether the hardware device is seem by the system. (you've already done that). This gives you the device name, /dev/rdsk/<whatever>

  1. You need to stop the automatic volume management services while you manipulate the USB device

On Solaris 10: (post if you have a prior version)

 
svcadm disable volfs
  1. Create a partition on the USB device using:
  1. Create a filesystem (assume UFS here) on the USB device:
 
newfs /dev/rdsk/<whatever>
  1. Create an arbitary mount point (typically a top level directory using mkdir) eg.
 
mkdir usbstick
  1. Mount the USB filesystem under this mount point
 
mount /dev/dsk/<whatever> /usbstick

You can then copy stuff to your new USB based filesystem under the /usbstick directory.

After you're done you can sync and umount the filesystem and remove the stick.

If the USB device is already formatted with another filesystem eg. NTFS, then you should be able to just do steps 5 & 6.

Hope that helps.

Post back any questions.

---------- Post updated 11-10-12 at 09:32 AM ---------- Previous update was 10-10-12 at 07:33 PM ----------

Forgot to say that if the USB device is preformatted on another system eg, fat32, you will need to tell the mount command (in step 5) that it's not a native Solaris filesystem by using the -F switch on mount (see man pages).

For example:

mount -F pcfs /dev/dsk/c5t0d0s0 /mnt

or whatever suitable -F argument to tell Solaris what format to look for.

I had found another article and followed the directions on it. It can find the usb, I have the directory showing (it said to do mount /dev/dsk/<blahblah> /mnt. I'm not having any errors returned, but it's not saving to the usb.

Is there a way to start over and follow hicksd8? (It's an FAT usb, btw)

(Have I mentioned that the first time I used Solaris was when they said "Congrats! Here's your lab, now go make it work")

Thanks!

~K

I think that you might need to format it fat32 (on another machine).

If the mount command gives you no errors, you should be able to see it listed in the output of the command:

Once you can see it there you can copy files to the USB device by copying them to /mnt (or whatever mountpoint you used).

Please provide some clues about what you are doing and how it fails.

Using an usb disk is generally quite simple, especially when the file system is fat.

  • Plug the device and it is automatically mounted, "df -h" will tell you where.
  • Write your file on it using the CLI or a file manager.
  • Unmount the device before unplugging it to avoid media corruption and that's it.

Disabling the automounter makes thinks more complex so is generally not advisable.

I agree that you don't need to disable the automounter if the USB device is preformatted by another system but if you want to write a native Solaris filesystem to the USB device you will need to run fdisk and you cannot do that (without errors) with the automounter on.

I see it when I run the mount command. I can move files to my /mnt, I can see them if I do an ls. When I try to find it on my windows machine, it says the drive is empty.

I'll try making it FAT32. And let you know the results.

---------- Post updated at 02:31 PM ---------- Previous update was at 12:17 PM ----------

So, changed the USB to FAT32, checked that it was picked up by solaris, no mount issues, no moving file issues, no sync issues, still showing nothing on the usb.

Did you change the partitions in any way? Microsoft Windows doesn't show multiple partitions on removable drives...

i attempted to make a partition initially, but it kept coming back saying it couldn't partition the usb, so no.

Are you dismounting the USB device cleanly?

 
sync
umount /mnt

Otherwise the USB contents could be in cache and not actually written out before you disconnect the USB.

(To all experts reading this: yes, I know sync is probably no longer required but no harm done in doing it.)

@kuriosity_prime What report the following commands (as root, ksh/bash syntax):

rmformat
iostat -En
for i in $(rmformat | grep "Logical Node" | nawk '{print $4}')
do
        pfexec fdisk -v -W - $i | grep -v : | grep -v '^*$'
        for p in 1 2 3 4
        do
                printf "%d " $p
                fstyp $(echo $i | sed 's/.$/'$p'/')
        done
done

Hope this is what is expected

rmformat

Looking for devices...
     1. Logical Node: /dev/rdsk/c0t0d0s2
        Physical Node: /pci@1e,600000/ide@d/sd@0,0
        Connected Device: TEAC     DV-28E-V         1.AB
        Device Type: DVD Reader
     2. Logical Node: /dev/rdsk/c4t0d0s2
        Physical Node: /pci@1e,600000/usb@a/storage@2/disk@0,0
        Connected Device: USB      Flash Disk       1100
        Device Type: Removable

iostat -En

c1t1d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU  Product: MAW3073NCSUN72G  Revision: 1703 Serial No: 0738B0NTRG
Size: 73.41GB <73407865856 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
c1t2d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: SEAGATE  Product: ST373307LSUN72G  Revision: 0507 Serial No: 0340B64WYL
Size: 73.41GB <73407865856 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
c3t0d0           Soft Errors: 0 Hard Errors: 2 Transport Errors: 91
Vendor: USB      Product: Flash Disk       Revision: 1100 Serial No:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 11 Predictive Failure Analysis: 0
c1t0d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU  Product: MAW3073NCSUN72G  Revision: 1703 Serial No: 0723B0ME5H
Size: 73.41GB <73407865856 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
c4t0d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: USB      Product: Flash Disk       Revision: 1100 Serial No:
Size: 4.01GB <4010803200 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 44 Predictive Failure Analysis: 0
c0t0d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 1
Vendor: TEAC     Product: DV-28E-V         Revision: 1.AB Serial No:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0

for i in $(rmformat | grep "Logical Node" | nawk '{print $4}')
do
pfexec fdisk -v -W - $i | grep -v : | grep -v '^*$'
for p in 1 2 3 4
do
printf "%d " $p
fstyp $(echo $i | sed 's/.$/'$p'/')
done
done

bash-3.00# for i in $(rmformat | grep "Logical Node" | nawk '{print $4}')
do
        pfexec fdisk -v -W - $i | grep -v : | grep -v '^*$'
        for p in 1 2 3 4
> do
   >         pfexec fdisk -v -W - $i | grep -v : | grep -v '^*$'
                printf "%d " $p
                fstyp $(echo $i | sed 's/.$/'$p'/')
        done
done
>         for p in 1 2 3 4
>         do
>                 printf "%d " $p
>                 fstyp $(echo $i | sed 's/.$/'$p'/')
>         done
> done
fdisk: Cannot open device /dev/rdsk/c0t0d0s2.
1 getdisk/read: I/O error
/dev/rdsk/c0t0d0s1: Error 0
/dev/rdsk/c0t0d0s1: I/O error
Unknown_fstyp (no matches)
2 hsfs
3 getdisk/read: I/O error
/dev/rdsk/c0t0d0s3: Error 0
/dev/rdsk/c0t0d0s3: I/O error
Unknown_fstyp (no matches)
4 getdisk/read: I/O error
/dev/rdsk/c0t0d0s4: Error 0
/dev/rdsk/c0t0d0s4: I/O error
Unknown_fstyp (no matches)

* /dev/rdsk/c4t0d0s2 default fdisk table
*    512 bytes/sector
*     63 sectors/track
*    255 tracks/cylinder
*    487 cylinders

* Id    Act  Bhead  Bsect  Bcyl    Ehead  Esect  Ecyl    Rsect      Numsect
  11    128  1      1      0       127    54     971     3192       7830408
1 hsfs fstyp: cannot open </dev/rdsk/c4t0d0s1>
/dev/rdsk/c4t0d0s1: No such device or address
udfs fstyp: cannot open </dev/rdsk/c4t0d0s1> errorno <6>
/dev/rdsk/c4t0d0s1: No such device or address
open64: No such device or address
Unknown_fstyp (no matches)
2 ufs
3 hsfs fstyp: cannot open </dev/rdsk/c4t0d0s3>
/dev/rdsk/c4t0d0s3: No such device or address
udfs fstyp: cannot open </dev/rdsk/c4t0d0s3> errorno <6>
/dev/rdsk/c4t0d0s3: No such device or address
open64: No such device or address
Unknown_fstyp (no matches)
4 hsfs fstyp: cannot open </dev/rdsk/c4t0d0s4>
/dev/rdsk/c4t0d0s4: No such device or address
udfs fstyp: cannot open </dev/rdsk/c4t0d0s4> errorno <6>
/dev/rdsk/c4t0d0s4: No such device or address
open64: No such device or address
Unknown_fstyp (no matches)

Is this SPARC ?

You have likely a 4 GB USB thumbdrive with a single ufs file system on it. Therefore there is no fat32 and that makes the drive unusable with windows or other OSes.

It has been formatted to FAT32, it was ntfs

"fstyp /dev/rdsk/c4t0d0s2" is reporting the file system there to be ufs, not fat32. Don't confuse partition IDs and file systems types.

What says

fstyp -v /dev/rdsk/c4t0d0s2
fstyp -v /dev/rdsk/c4t0d0s2:c

?

fstyp -v /dev/rdsk/c4t0d0s2

cg 79:
Invalid Cylinder grp magic fffs:0  4.2 fs:0

log
log allocation block 98304
log size 0 bytes (0 calculated)

version         868257488               logstate        Error
bol             1471800577              eol             -207303747
requestsize     3188175108
statesize       946733180
logsize         158667651
maxtransfer     4240317308              devbsize        3206219344
head            -2084171703             head ident      0x7419382c
tail            1962320053              tail ident      0x7b4078b
                                debug           0xb40ecd
Bad chksum      0xf0ac3c00

fstyp -v /dev/rdsk/c4t0d0s2:c

 fstyp -v /dev/rdsk/c4t0d0s2:c
fstyp: cannot stat or open </dev/rdsk/c4t0d0s2:c>

Plug this USB device into a Windows system, use disk administrator (or any other utility) to blow away the filesystem AND the partition. Get it showing up as 'free space'. Then create a new partition (primary partition) and format it fat32.

You could then test it by copying files to/from the Windows system.

Eject and move to Solaris and mount it. You'll probably need -F pcfs on your mount command to tell Solaris it's a Windows drive.

Now test copying to/from the Solaris system.