![]() |
smbclient & dd
you know I am told to get an image of the whole ubuntu system on my server shared folder.
If you have used dd before to get an image of the occupied space on the system please lemme know bout your command. (I preferably want dd to only get an image of the occupied file system not the free space) Well, here comes the next part. You know, though I can view my server shared folder graphically, I cannot do it using shell command. The server has the following path: Code:
smb://username@safe/mysharedfolderI tried different commands for smbclient to connect to the server but it failed. Any helps would be appreciable. |
dd will copy everything, including free space but you can a) set the free space to all zeroes and b) compress the output. Assuming the file system you want to copy is / and it is on /dev/sda1, as root:
Code:
dd if=/dev/zero of=/trash |
It isn't clear whether you want to use the SMB filesystem as the source or as the destination of the dd image. dd works on files and devices, but not on network shares, which are neither. If you want to make a backup of a network share, you are much better off to use either a backup utility (maybe even dd) on the file server host.
If you want to make an image of a partition on a local filesystem, and store the image as a file on a network share, then I suggest mounting the SMB share on your local filesystem before starting to create the dd image, and use the mounted network filesystem as the storage for the dd image. Making a dd image of a mounted partition is a recipe for BAD THINGS. A file oriented backup using rsync is probably a better idea, and will be more efficient in terms of net data transfer, and size of the resulting copy, although the result will not be a single image file. You can still create a single file version of the backup, if that is what you require for archival or transport purposes. --- rod. |
Quote:
and, let's be more accurate here, I need frist to mount my server shared folder using this mount -t cifs //safe/mysharedfolder -o username=user,password="password" /mnt/share and then get a backup of whole system n place it on server. this I shall only change the path to file not on root filesystem to /mnt/shared right? Code:
dd if=/dev/zero of=/trash |
Same as what theNbomr wrote -- using dd to copy a mounted file system is not good so, if it is the / file sytem you want to back up you can't umount it while it is being used to run GNU/Linux. The solution is to boot GNU/Linux from a CD or DVD.
|
Quote:
--- rod. |
Quote:
|
Any CD/DVD that does not mount the partition which you are trying back-up would be suitable. That probably includes most live CDs/DVDs, including most installation CDs. If you can get to a shell, you should be able determine what is mounted by either running mount with no arguments, or inspecting /etc/mtab. Even if the target partition is mounted, you can very likely safely unmount (umount) it for the purpose of making a backup.
--- rod. |
| All times are GMT -5. The time now is 11:09 PM. |