Rescue a crashed computer

Uit DeVliegendeWiki

Ga naar: navigatie, zoeken

Here are some experiences with rescueing a crashed computer

Inhoud

Access Computer through Ubuntu Live CD & Gnome

Once in a while, I have a laptop where I cannot easily take out the harddisk for backing up. It would be cool if I could boot from a Linux CD (e.g., Ubuntu Live CD), access the HD + some backup media, and backup the harddisk.

So far, I have never had good experiences with live CD's. They seem to take forever to boot,if they boot at all. Recently, I succeeded with the following procedure:

  • Just get as far as possible with the live CD
  • Press ALT-1 (or was it ALT-F1?) to get somehow to a console
  • Type startx, and tada... Where in Gnome! The root password is empty in these cases.

The alternative would be to do everything from the console, but so far, I didn't feel like having to mount devices. When using Gnome, this seems to be taken care of already.

Conclusions

Again, live CD's don't seem to work for me: it kept loading from the CD like forever. Let's try a shell

Access Computer through Ubuntu Live CD & Shell

Here's the procedure:

  • Start with the Ubuntu live CD untit it starts complaining about something
  • Use ALT-F1 to get to a console.

Mount the harddisk

This specific computer has one harddisk, which seems to be partitioned in three (or more?) parts:

ls /dev/h*
/dev/hda /dev/hda1 /dev/hda2 /dev/hda3 /dev/hda5 /dev/hdc /dev/hpet

I issued:

sudo mount /dev/hda1 /media/win1

and after this, I could read the partition like through

ls /media/win1

However, this doesn't seem the partition I'm looking for. Let's try again:

sudo mkdir /media/win2
sudo mount /dev/hda2 /media/win2

Tjakka! It worked. Apparently, without an endless string of obscure switches. Maybe this HD somehow wasn't formatted with NTFS or so.

However,

sudo mkdir /media/win3
sudo mount /dev/hda3 /media/win3

gave error:

mount: you must specify the filesystem type

So I am afraid it's time to get more into mount:

More about mounting this hda3

Let's start with the mount --help:

Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
One can change the type of mount containing the directory dir:
       mount --make-shared dir
       mount --make-slave dir
       mount --make-private dir
       mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
       mount --make-rshared dir
       mount --make-rslave dir
       mount --make-rprivate dir
       mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .

This doesn't help too much. Actually, http://www.techonthenet.com/linux/mount.php suggested to try:

sudo mount /dev/hda3 /media/win3 -t ntfs

which resulted in:

Failed to mount '/dev/hda3': Invalid argument
The device '/dev/hda3' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

I give up here.

Mount USB stick

I could identify what devices are related to my USB stick by inserting and ejecting the stick several times:

/dev/usbdev4.3_ep00
/dev/usbdev4.3_ep01
/dev/usbdev4.3_ep81.

Actually, when I insert it, the shell says something that seems to identify the device as sda. However, when issueing:

sudo mount /dev/usbdev4.4_ep00 /media/usb1

I get the error:

/dev/usbdev4.4_ep00 is not a block device

BTW: The numer after usbdev seems to increase constantly.

Anyhow, this avenue doesn't seem to go nowhere. Let's try to mount that mysterious sda device:

sudo mount /dev/sda /media/usb1

which gave an error about an unknown file system. On a windows computer I checked, and the file system was FAT.

sudo /mount /dev/sda /media/usb1 -t fat

gave an error that fat is an unknown option, and that maybe i ment vfat. Whatever:

sudo /mount /dev/sda /media/usb1 -t vfat

didn't result in anything more sensible.

Ah, http://www.cyberciti.biz/tips/linux-how-to-use-usb-penflash-stick.html suggests that USB-devices are treated like SCSI-devices (that's funny: Windows NT used a similar SCSI-simulation for ATA harddisks). That's where the obscure sda device opped up when inserting the USB stick.

The solution

sudo mount /dev/sda1 /media/usb1

Again, the trick is to mount the partition sda1, rather than trying to mount sda itself.

Access computer with Bootable CD

I have a bootable CD, that boots into some DOS-like environment. Questions are (1) Can it read the hard disk, which probably is formatted as NTFS? (2) Can it access a device like a USB stick?

Persoonlijke instellingen