Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im trying to image one laptop to the rest of my wireless laptop lab, so figured I could use G4L to do this. I didn't know how to set the G4L boot disk up to recognise my wireless card so I needed to backup/restore to DVD. I managed to write my image file and burn it to a DVD, but when I boot up into G4L I cant choose the DVD drive as a local restore point option.
Did some research and found that I am supposed to mount the drive, but when I run cat /etc/fstab I cant see anything that looks like a DVD drive to mount. - here is the output
/dev/ram0 / ext2 rw 0 0
proc /proc proc rw 0 0
When I run the same command on my working OpenSUSE 10.3 laptop I still don't see anything that looks like a DVD drive - here is the output
thx for the quick reponse, but I am still confused. You say to determine what the device is, but this is what I seem to be having trouble doing. there doesn't seem to be a device listed when I run the cat /etc/fstab
How else do I determine what the device is?
Im sure its something simple but I just cant find how to do it...
not sure what dmseg is supposed to do, I couldnt find much info on the web, anyway, when I tried it I just got command not found is there a package I need to install for this?
/etc/fstab holds information mostly about devices that are constantly available, like internal hard drives. A DVD is a typical removable data storage unit, so you won't have it in /etc/fstab.
You wrote that the device is working fine, so you should see the device mount point when running 'df' on the command-line. Then again, you don't need to mount it again if it is auto-mounted already.
df does not come up with anything interesting under the G4L bootdisk - just rootfs and /dev/root
so I tried df on my working laptop in OpenSUSE 10.3 and again nothing - unless I have a DVD in the drive - so I guess it mounts and unmounts the drive automatically? so, I found the device name on the working laptop - /dev/sr0 - cool. maybe it is the same on both laptops?
so I have tried to mount that same device name on the laptop I am trying to image, it says special device /dev/sr0 does not exist.
Next I tried booting up the working laptop with G4L and tried mounting /dev/sr0 on that laptop I get exactly the same results. - does not exist
It seems something is actually missing from the G4L bootdisk - none of the hard drive partititons appear when running cat /etc/fstab, but when I enter G4L it shows all of them as sda sda1 sda2 etc (no DVD drive though)
Can anyone explain to me (or point me in the direction of a resource which will explain) exactly how and when the devices are recognised on bootup? tried to research it but cant find the info.
I know that restoring an image from a dvd can't be that difficult - there must be something fairly basic I am missing.
ok - scrap that - Ive found out the device name using this code
cat /proc/sys/dev/cdrom/info
so my dvd drive is hda
so now I can mount this drive using
mount -t iso9660 /dev/hda /media/cdrom
all cool. can browse to the directory and look at the files. brilliant.
but when I go back into G4L I still cant see how to restore from this. when I go to the options of local drive to choose from it just has sda, sda1, sda2, sda3 etc.
So I boot up with G4L which means I am running on a Ramdisk yes?
So if I mount my DVD it is mounted in the Ramdisk, how do I mount it onto one of the harddrive partitions? (which I guess I need to do as only the harddrive partitions are appearing in G4L)
Do I have to mount the partition to the ramdisk and then mount the DVD to that?
Or does anyone know an alternative to what I am trying to do? starting to think that G4L is not the tool I need...
If you are running from a Live distro, the root directory (/) is in ram. You can mount the dvd on one directory and the target drive on another (assuming g4l doesn't restore to the partition device). The g4l program may restore to the partition itself as in to /dev/sda2. Generally, I would use a file based backup instead of a imaging program, unless this was for a fresh installation.
If it were a fresh installation, I would A) create a file of zeroes filling up the partition to zero out unused space on a reused partition. B) delete this file C) use the dd command to create the image D) pipe the output through either gzip or bzip2 to compress the image E) if the image were >4.7GB, pipe the output through the split program if I wanted to save smaller slices on DVDs. Saving to a network share or an external drive would work out better. If there is a 2GB limit on file sizes then split may still be necessary.
As a demo, here I will create a compressed image of my /boot partition:
Code:
> mount | grep /boot
/dev/sda1 on /boot type ext3 (rw,acl,user_xattr)
> df /boot
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 155543 24602 122911 17% /boot
> sudo dd if=/dev/zero bs=1024 count=122910 of=/boot/zerofile
root's password:
122910+0 records in
122910+0 records out
125859840 bytes (126 MB) copied, 2.05592 s, 61.2 MB/s
> df /boot
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 155543 147996 0 100% /boot
> sudo rm /boot/zerofile
> sudo dd if=/dev/sda1 bs=1024 | gzip - >backup/sda1.img.5-10-08.gz
160618+1 records in
160618+1 records out
164473344 bytes (164 MB) copied, 8.6136 s, 19.1 MB/s
> ls -lh backup/sda1.img.5-10-08.gz
-rw-r----- 1 jschiwal jschiwal 19M 2008-05-12 20:47 backup/sda1.img.5-10-08.gz
The first dd command was used to create the "zerofile" consisting of just zeros and filling up the free space. The second dd command was used to create the image file which was compressed using gzip before saving it.
Except that I would probably be running from a boot disk or live distro, so the path to the sda1.img.5-10-08.gz file would be different. Running under a boot disk, I would be the root user as well so "sudo" wouldn't be necessary. You would need to partition the disk drive first, unless you have identical drives and copy the MBR as well.
PS. On SuSE 10.3 for some reason, kdar isn't available. I had used it with SuSE 10.2. I installed the old version after extracting libdar-3.0.so from a SuSE 10.2 package. This allowed the SuSE 10.2's kdar package to be installed.
dar stands for disc archive. It is like tar but creates slices that you can burn to a CD or DVD disc. Kdar is a kde front end allowing you to use dar in the gui. It works a lot like backup exec in windows. You can even export a bash script that uses the dar command to restore the backup from the console rather than using kdar. A backup job can also be setup and exported as a script. This would allow you to use this script in a cron job to perform routine incremental backups automatically.
PPS.
It has been a while since the first post, and I forgot when responding that you were duplicating an installation instead of a general backup.
One last thing, in your first post, you mentioned a local restore point. That sounds more like the device to restore to rather than the source of the image.
Simply duplicating an image to another computer will mostly work if the destination hardware is the same. You will need to change some things such as any unique static network settings such as the IP address, and the hostname. If the target machine has different hardware, you may need different kernel modules in the initrd file to enable it to boot. A different machine using a different wireless card will need different firmware for the wireless to work.
thx for that info - just in reply, yes, I want to reproduce an installation on identical laptops, mainly because it was a headache to get the wireless working and thought it would be easier just to image the successful installation across. Well, no, but at least Im learning a lot more!!!
The restore point was just my language which could have been misleading - it is definitely the image source I couldnt locate on DVD.
I have to say that as someone who has imaged hundreds of windows PC's in the past that I am quite surprised there isnt an easier way to do this. Well, I guess G4L is simple enough IF you have a network available to backup/restore from, but surprising that this seems assumed in the programming - 50% of the time I have done imaging in the past it has been locally.
Yes, it seems G4L does restore directly to the partition itself, the problem is I can mount the DVD but it is mounted through the ramdisk and I cant select the path to it through G4L (because it ONLY has the partitions as possible selections to restore from/to) If that makes sense.
anyway, I will attempt your command-line suggestion and see how I go.
I can't imagine that you can't select an image file produced by g4l itself and use that to restore a partition. The devices listed (sda1, sda2, etc) sound like the target rather than the source.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.