LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-13-2007, 07:28 PM   #1
mkhan919
Member
 
Registered: Jan 2007
Location: Valbonne, France
Distribution: Mandriva 2008 (Free)
Posts: 135

Rep: Reputation: 15
Unhappy :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 ...

Last edited by mkhan919; 02-13-2007 at 07:30 PM.
 
Old 02-13-2007, 07:57 PM   #2
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
if I not mistaken mounting iso file must issue command:-
mount -t iso9660 -o loop /path/to/isofile /temp
 
Old 02-13-2007, 08:05 PM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.
 
Old 02-13-2007, 08:08 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,838

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
Maybe make that "if=/dev/sdb2/Linux.img"
 
Old 02-14-2007, 06:19 AM   #5
mkhan919
Member
 
Registered: Jan 2007
Location: Valbonne, France
Distribution: Mandriva 2008 (Free)
Posts: 135

Original Poster
Rep: Reputation: 15
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
 
Old 02-14-2007, 06:25 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,838

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
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.
 
Old 02-14-2007, 07:25 AM   #7
mkhan919
Member
 
Registered: Jan 2007
Location: Valbonne, France
Distribution: Mandriva 2008 (Free)
Posts: 135

Original Poster
Rep: Reputation: 15
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

Last edited by mkhan919; 02-14-2007 at 07:26 AM.
 
Old 02-14-2007, 08:06 AM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.

Last edited by saikee; 02-14-2007 at 08:50 AM.
 
Old 02-14-2007, 08:40 AM   #9
mkhan919
Member
 
Registered: Jan 2007
Location: Valbonne, France
Distribution: Mandriva 2008 (Free)
Posts: 135

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create your own live boot CD containing your favorite Distro from scratch babytux Linux - Distributions 1 08-19-2003 01:44 PM
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 06:11 AM


All times are GMT -5. The time now is 01:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration