smbclient & dd


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users smbclient & dd
# 8  
Old 03-01-2012
This is made much more complicated by it being sda6. That's 2 beyond the limits of the DOS boot sector, which places it in an extended region that's not backed up when you back up the boot sector. So my instructions no longer apply.

That it's sda6 at all suggests there's 4 partitions before it(not 5, sda5 is special) whose contents are at best unknown here.

This is why you need to be familiar with it, to know the implications of what you're doing -- to know what will and won't work and why.

Don't make me regret trying to help you. Don't do it.
# 9  
Old 03-02-2012
Quote:
Originally Posted by Corona688
You're not familiar with it. Don't try it.
You suggest the best option is the best n telling me not to use it i can't, so, what's the point then? m wasting all my comments, bcoz it ended up with nothing!
# 10  
Old 03-02-2012
Quote:
Originally Posted by dr_mabuse
You suggest the best option is the best n telling me not to use it i can't, so, what's the point then? m wasting all my comments, bcoz it ended up with nothing!
I gave you several options, but you refused most of them, even though I warned you -- repeatedly -- that this way was the most difficult and troublesome and likely to end in disaster. You wasted your own time.
# 11  
Old 03-03-2012
Quote:
Originally Posted by Corona688
These GUIs can be misleading since the actual underlying filesystem isn't using URL's.

To actually mount a CIFS file share(CIFS = samba shares / windows shares / etc) with mount:

Code:
# /mnt/share, or wherever you mount it, should already exist and
# be an empty folder.
mount -t cifs //safe/mysharedfolder -o username=user,password="password" /path/to/mountfolder

---------- Post updated at 12:22 PM ---------- Previous update was at 12:16 PM ----------

dd isn't psychic. dd won't know and cannot know what space is occupied, that's handled at the filesystem level. You need to use filesystem-specific tools to handle that, and how that's done depends on the filesystem type.

Three options:

1) Do it manually. Save your boot sector and /etc/fstab so you know what kind of partitions belong where, then create tarballs of the contents of every partition. By restoring the boot sector, 'w'-ing it inside 'fdisk', re-creating empty partitions and un-taring their contents in them, you ought to create a bootable system.

2) Cheat, forcing an ordinary dd dump to compress better. Boot a livecd and mount partitions, then 'dd if=/dev/zero of=/mnt/partition/bigfile bs=1048576 ; rm /mnt/partition/bigfile' to overwrite all unused space with zeroes. When you make your dd dump, it should now compress very well when piped through gzip because all empty space will contain zeroes.

3) Use partiton-specific tools. (dump can understand ext2/ext3)

I usually do option 1, myself, since it allows you to create a new system with different partition sizes on restore, though it's fiddly and a lot more work.
I tried your command, but it fails:

saman@saman-G41MT-ES2L:~$ sudo mount -t cifs //safe/tabatabaian_s -o username="myuser",password="mypass" /mnt/share
mount: wrong fs type, bad option, bad superblock on //safe/tabatabaian_s,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so

this is the location I can reach via graphics browser:smb://safe/tabatabaian_s/

---------- Post updated at 02:18 AM ---------- Previous update was at 02:13 AM ----------

Quote:
Originally Posted by Corona688
I gave you several options, but you refused most of them, even though I warned you -- repeatedly -- that this way was the most difficult and troublesome and likely to end in disaster. You wasted your own time.
whatever, that's my own business if it's the most difficult way or whatever, i can choose this option as long as it is mentioned in your post!
# 12  
Old 03-04-2012
The command told you where to find better error messages. Did you run dmesg | tail yet? Did you get any interesting output from it?

I also told you to try the //IPaddress if //servername didn't work, did you try it?

I also told you smbfs://-style things and URL's in general make no sense at all in shell. Actual file paths don't work that way. I wasn't kidding. I use CIFS mounts all the time.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Error on smbclient login on Red Hat

I have the smbclient installed and I am able to see information from the '-L' option. But when I attempt to login I'm getting the "NT_STATUS_BAD_NETWORK_NAME". I was hoping for help, because I'm not sure what is supposed to go into the smb.conf file. My goal is to transfer files from my Linux... (2 Replies)
Discussion started by: islanderman
2 Replies

2. UNIX for Dummies Questions & Answers

Using command line variables in smbclient

Hi All, Have written a couple of lines to move the contents of a folder from a unix box to a windows location using smbclient (below) smbclient '{servicename}' -A ~/.smbclientauth -c 'mkdir \test_folder"' smbclient '{servicename}' -A ~/.smbclientauth -c 'cd "; lcd ";... (4 Replies)
Discussion started by: gary2410
4 Replies

3. Shell Programming and Scripting

Shell Script - If and smbclient (ftp)...help

Hi, So I am writting a script to copy files from Linux to windows using smbclient, I have done this a fair amount of times now. Unfortunately this time I am using a simply if statement to determine if the file exists before beginning the smbclient section.....however if I tab the smbclient... (4 Replies)
Discussion started by: mcclunyboy
4 Replies

4. Shell Programming and Scripting

Issue on smbclient

Hi All, I've been facing on this issue. From SunOS to Windows /usr/local/samba/bin/smbclient \\IP\<source dir> -D $TARGET_DIR -U dir1/$WINDOWS_USER%$WINDOWS_PWD -c "put $SOURCE_FILE $TAR GET_FILE;exit" This command in my shell script work fine but the file saved on windows environment... (3 Replies)
Discussion started by: gio123bgg
3 Replies

5. Shell Programming and Scripting

smbclient - check if 'cd' is sucessful?

Hi, I've a question regarding a smbclient-Command in my shell script. Here my relevant script part: fileattr=`/opt/samba/bin/smbclient --authentication-file=$AUTH_FILE //$SMB_HOST/$SMB_SHARE 2> /dev/null prompt off cd $SMB_DIR put $LOC_FILE $SMB_FILE dir /$SMB_DIR/$SMB_FILE ... (17 Replies)
Discussion started by: FreddyDaKing
17 Replies

6. Shell Programming and Scripting

Using the smbclient

Hi, I am trying to use smbclient to send message to a windows machine.It is showing "connection failed message" . After googled I came to know about "smbfind" which will give me the nodes in my network. In that list the machine name was not present where I was trying to send the message. ... (1 Reply)
Discussion started by: forstudy3
1 Replies

7. UNIX for Dummies Questions & Answers

Smbclient on Unix

The directory on windows server is renamed and I need to change the directory location on smbclient on unix. How do i do that, please advice. (2 Replies)
Discussion started by: welldone
2 Replies

8. UNIX for Dummies Questions & Answers

smbclient print while preserving windows printer settings?

I have successfully gotten AIX to print to a windows shared printer with this command: smbclient -U user%password -W domain -c "print file.ext" the only problem is: I have this print queue set up on the Windows side to overlay an image to all pages. When printing from samba, the overlay... (2 Replies)
Discussion started by: raidzero
2 Replies

9. Solaris

Connect smbclient to an windows server 2003 with active directory

Hello everybody .. i want connect with smbclient to an windows server 2003 with active directory. Exist a version of samba that can do this? Thank you very much for your time. Good Luck :b: (3 Replies)
Discussion started by: enkei17
3 Replies

10. UNIX for Advanced & Expert Users

Incomplete reading and transferring zip file via SAMBA smbclient

Hello, Anyone out there can help on this problem? I have a zip file about 34MB containing a file in EBCDIC and is resided on a Windows 2000 server. This zip file is retrieved and read from a UNIX server via SAMBA "SMBCLIENT" (by default the file is transferred via command bin) and issued... (2 Replies)
Discussion started by: eddie Law
2 Replies
Login or Register to Ask a Question