I have a messed up hard drive that, when I boot it, just drops to initramfs. I am a newbie to ubuntu, and I think the hard drive is failing. Is there any way to "take my files and run", per say? Like, on a disk or a flash drive, or even just from my livecd? Thanks
Yes, you can. It does not matter if it is a livecd or a bootable flash drive. You just mount your partitions in the live session and then you can start copy the files.
To mount a disk from a livecd you to know 3 commands.
List your partitions, you need to know the device names, like /dev/sda1.
sudo fdisk -l
Mount the disk, lets say that you want to mount /dev/sda1. You dont need to specify filesystem if you use ext file systems.
sudo mount /dev/sda1 /mnt
Now you can copy your files from /mnt with the filemanager.
And you might need to unmount the disk
sudo umount /mnt
You can use live Ubuntu CD and go to root access ($ sudo su) to remove what packages you have installed. Second option, you can recover all your data.
You can get all require information from below website link. I also faced same problem after smart command failed, and I recover each and every single piece of file from my unbootable Ubuntu desktop by a Live CD. After boot your system with Ubuntu Live CD, open your terminal and type following command with realizing.
$ df -h
Filesystem Size Used Avail Use% Mounted on /cow 976M 947M 0 100% / none 4.0K 0 4.0K 0% /sys/fs/cgroup udev 2.0G 4.0K 2.0G 1% /dev tmpfs 393M 1.2M 392M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 156K 2.0G 1% /run/shm none 100M 40K 100M 1% /run/user /dev/mapper/ubuntu--vg-root 1.8T 1.4T 340G 81% /media/ubuntu/02b97ef7-48ed... /dev/sdb1 932G 746G 186G 81% /media/prasenjit/ PRASENJIT EXT
Don't analyse this filesystem they may not match with your system. I edited little bit, but you should know in which drive you have the desire data, like /media drive.
So, you able to read all device at your terminal, where unbootable system file and personal data in /dev/mapper/ubuntu--vg-root and a external hard drive at /dev/sdb1 which I used for copy purpose for my system.
It will give you to access root, pretty cool. You don't need passwd for a Ubuntu Live CD.
~# mkdir /mnt/ubuntu--vg-root
Create a mount point directory at /mnt
~# mount /dev/mapper/ubuntu--vg-root /mnt/ubuntu--vg-root
Mount the partition /dev/mapper/ubuntu--vg-root on mounting point /mnt/ubuntu--vg-root
~# cd /mnt/ubuntu--vg-root/home/"user name of unbootable ubuntu system"
Now you can access some of your unbootable system's file but not all, anyway you have root access on terminal, so you can change the permission of file on terminal.
~# chmod 777 "name of the file/folder you want to access" -R
Now you can graphically click ---file directory >> Computer >> mnt >> ubuntu--vg-root >> home >> "your user id of unbootable system" >> your desire file/folder.
~# umount /dev/mapper/ubuntu--vg-root
Now you can unmount the drive which you mounted.
We are done!
Here's a link!