LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   :scratch: mouting problem with Live CD (https://www.linuxquestions.org/questions/linux-newbie-8/scratch-mouting-problem-with-live-cd-528816/)

mkhan919 02-13-2007 06:28 PM

:scratch: mouting problem with Live CD
 
Hi,

Some time ago i took an image(made a copy of the entire partition using dd command)on my linux installation partition on my external usb hard disk . Now i wish to overwrite my linux installation partition with that image file. From what i understand i need to do the following:

a) boot the system from any linux disk (i am using Knoppix 5.1.1 LiveCD here).

b) mount the usb drive. (it is mount automatically by knoppix under /dev/sdb2

--> Big problems here. the image file is /mnt/sdb2/Linux.img . i created a new dir 'temp' in /mnt (i think this dir is in ram since i am using a LiveCD).
mount -o /mnt/sdb2/Linux.img /temp

This should mount the image to the mentioned directory. But knoppix gives me an error saying no such mount point in /etc/fstab or /etc/mtab.

i tried being clever and edited the /etc/fstab file but :
a) mount -o option does not seem to work there.
b I tried using the same syntax as is being using my knoppix to mount /dev/sbd2 to /mnt/sdb2 (in place of it , i used /mnt/sbd2/Linux.img /mnt/temp), knoppix says the special device /mnt/sdb2/Linux.img does not exit..


I am stuck here. How can i mount this file to a directory so that i can overwrite my existing partition with it????

Any suggestions or ideas ????



c) over write the parition using

dd if=/mnt/temp of=/dev/sda7 bs =1024k

This should do it?


PS: Can i make a similar king of backup with rsync ...... i this that would save a bit of space as well as time (when i update the backup so to speak)

Thank you for your help ...

kstan 02-13-2007 06:57 PM

if I not mistaken mounting iso file must issue command:-
mount -t iso9660 -o loop /path/to/isofile /temp

saikee 02-13-2007 07:05 PM

Why bother to mount it if it is already mounted by Knoppix?

If you use bs=1024K before then I would restore it by
Code:

dd if=/mnt/sdb2/Linux.img of=/dev/sda7 bs =1024k
If should work if the partition size has not been altered.

syg00 02-13-2007 07:08 PM

Maybe make that "if=/dev/sdb2/Linux.img"

mkhan919 02-14-2007 05:19 AM

Thnx guys...... I was trying to mount it just to verify it everything is in order with the back up i made. i'll try that and report back here as to what happened.
Thnx again

syg00 02-14-2007 05:25 AM

Somehow I missed the post from kstan.
Mounting it loop is probably the answer, but it won't be iso. Try leaving the type out, or use type auto, or whatever it really is if you know.

mkhan919 02-14-2007 06:25 AM

i managed to mount it alright. Now it is mounted on /mnt/Temp.

I tried the following:

dd if=/mnt/Temp of=/mnt/sda7 bs=1024k


I get the msg Temp is a directory. and nothing is copied.


I also tried

dd if=/mnt/sdb2/Linux.img /mnt/sda7 bs=1024k

Now i get the msg that /mnt/sda7 is a directory........Whats going on. I think it might work with /dev/sda7 , cause this was how i had created the backup in the first place. But what is the difference between saying /mnt/sda7 and /dev/sda7 ....?????

and just for the sake of it, why cant i get it to copy the mounted image (from /mnt/Temp to /mnt/sda7 )


Does it has anything to do with the way /dev/something is treated etc??


Thanx

saikee 02-14-2007 07:06 AM

If you think of it writing on /mnt/sda7 is a directory and therefore you need to give a name to the whatever being written there as Linux allows you to store many files inside so it has to know what it is called.

If you write on a device you don't need to give a file name because it is a native writing of "1" and "0" starting from the first sector and lasts as long as the source file, taking one record at a time with size specified as per "bs".

I doublt if the destination with a file name will work in dd in a full partition restoration because on dismounting Linux would not know where to copy the file to. In a normal dismount the files are written to the filing area starting from Sector 1 and the boot sector (Sector 0) is not touched. Whenn dd clones a partition it always starts with Sector 0 and so the boot sector is always included.

mkhan919 02-14-2007 07:40 AM

Thanx for clearing that bit of confusion up. I finally managed to restore the linux from the backup and now am backup and running again. It really was great. It had taken about 5-7 mins to create the backup image and same time for restoration. It really is a wonderfully cheap solution to taking backups.
lol

Thank you everyone for helping me through this.


By the way just for the sake of it, in case someone else stumbles across on this thread, i used

dd if=/mnt/sdb2/Linux.img of=/dev/sda7 bs=1024k

to overwrite my linux root partition with the backup.


All times are GMT -5. The time now is 09:59 PM.