LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 08-20-2013, 06:22 PM   #16
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,364
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981

Quote:
Originally Posted by maxreason View Post
Are you saying that no file in /boot is changed periodically, or changed as a result of the specific disks in the system?
The files in /boot are suspect to updates as any other file from any other package. If you just chroot into the broken system, mount the newly formatted /boot-partition and install the kernel and the bootloader you should get the newest kernel and bootloader packages. No need at all to install a whole system, although that approach also should work, if you also copy the kernel modules for the kernel version that comes with a fresh install. Partition sizes and partition type/partition table type do not matter.

Quote:
I don't know enough about backups, but... do people really back up system partitions like this? Seems like a backup of the entire system would be required to start, doubling storage requirements.
A freshly installed Slackware system id about 7-8GB, when I made my modifications I usually land about 9-10GB. Since Slackware has an everything-and-the-kitchen-sink approach I would think that an Ubuntu install is much smaller (the system requirements mention 5GB disk space as minimum). Seeing that the total storage size in your system is 5TB, is size of a backup really a concern for you?
Quote:
Furthermore, it also seems like one would need to create at least an incremental backup every single time they power down their computer. That seems like a sure way to fill up a drive with backup files in short order. Plus, how long would that add to the shutdown sequence anyway (to search the entire filesystem and backup all changed files in an incremental way)?
There are different techniques of backup. On Slackware I make a total system backup when I had major upgrades or big software installs, because Slackware is, when it comes to software that is not part of the standard installation, a mostly source-based system which involves sometimes a lot of compiling. Using rsync, this is not really a long procedure that can run in the background anyways.
On Ubuntu I would go for a different approach, I would backup the files in /boot, /etc and of course the configuration files in my /home directory. Then I would use dpkg to get a complete list of installed packages, so that I can simply re-install if needed. This procedure, when done on shutdown, should not last longer than a few seconds. I have done it that way when I was using Debian as my main OS (although I rather do my backups manually, not automatically), when I borked my system setting up a new one was a thing of about 15 minutes (I used network based installation with packages cached on a separate server).
Quote:
Every time I've ever read about backup techniques, I decide they are very difficult, probably not reliable, and figure that Murphy's Law dictates they probably won't actually work much of the time.
Any backup strategy must be tested, so that the "probably" in your statement is non-existent. Ironically, Murphy's Law is not predictable and hit you directly while not having a backup. A proper backup of your /boot-partition would have solved this issue in about 5 minutes.

Of course you should always have at least one backup copy of your valuable data, otherwise Murphy can hit you here also. I keep copies of my valuable data on at least one extra machine at home and one off-site.
 
Old 08-20-2013, 09:11 PM   #17
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit ubuntu 12.04 LTS
Posts: 205

Original Poster
Rep: Reputation: 15
Okay, I just bought another 2TB drive, and need to decide what approach to take.

Is there any reason I need to install 12.04 again, or can/should I just install 13.04 at this point? I guess the main point of my question is this. For practical purposes, pretty much everything I can think of that worries me on my now-defective 2TB drive is:

- codeblocks IDE with all the various configuration files.
- thunderbird email system with about 15 email accounts and tens of thousands of emails.
- a work-in-progress firefox extension, including the associated firefox development profile.

Of course I also have lots of .txt files, .pdf files, .jpg files, and other files that are standalone and not subject to configuration files or special applications. Of course I have lots of .h files, .cpp files, and other application in my /home/max/project directory, but all these I can just save and replace without application configuration worries.
 
Old 08-20-2013, 10:04 PM   #18
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,364
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
If you want to keep your configurations, I don't quite get why you want to do a reinstall at all, since we told you already that it most likely is not necessary. Why don't you just try to restore your boot partition in the way we described in previous posts?
If you really want to keep your configuration, even if you have to reinstall, I would definitively opt for 12.04 (which will give you support until 2017) instead of 13.04 (supported until 1-2014).

What I would do, just to be sure:
- Make a copy of your installed system to the new disk, just in case
- Try to repair the old one the way we described. If you need help with that just ask, we are here to help
- If that does not succeed, make a fresh install of 12.04 and install the latest updates
- Copy over your configuration files
 
Old 08-20-2013, 10:52 PM   #19
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit ubuntu 12.04 LTS
Posts: 205

Original Poster
Rep: Reputation: 15
The primary reason I consider creating a new installation is... the steps you guys tell me to do are not something I know how to do (though I basically understand what those steps mean). I'm fairly sure I'd screw something up.

However, if someone wants to give me step by step commands like eSelix did before, I'll give it a try.

Until I hear back from someone with these steps, I'll just install 64-bit ubuntu v12.04 on the new 2TB drive I just purchased (and copy my entire /home directory (and subdirectories) across to a backup directory on the new drive). Once I see the instructions, I'll try to fix the currently defective drive.
 
Old 08-21-2013, 04:51 AM   #20
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Kubuntu
Posts: 1,190

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Before installing new system disconnect all not need drives (leave only new). I had situation, where installer modified boot sector on wrong drive (actually it was my fault, but it should ask me which device to use).

Be sure to copy hidden files and directories from /home. You can also backup your old /etc, /usr/local, /opt, ... - depending where you did your own modifications.

Remeber that if you have connected more drives, then, without additional configuration, device names sda, sdb... can be assigned to different drives each time, so be sure which drive you operate.

For repairing, preffered is to disconnect all drives and connect only this malfunctioning one and other with working system (it can be LiveCD or LiveUSB), then you can try to recover old disk. Assuming it is /dev/sda1 you can do:
Code:
# Formatting old partition
mkfs.ext4 -m 0 /dev/sda1

# Mounting old drive
mkdir /mnt/old
mount /dev/sda3 /mnt/old
mount /dev/sda1 /mnt/old/boot

mount --bind /dev /mnt/old/dev
mount --bind /proc /mnt/old/proc
mount --bind /sys /mnt/old/sys

# Changing root directory
chroot /mnt/old
# Make sure all commands are successful

# Installing fresh /boot data
apt-get install grub linux
# When asking, install bootloader on /dev/sda
poweroff
Then disconnect drive with working system (or remove LiveCD) and boot from new system. Let us known if everything went well.

Last edited by eSelix; 08-21-2013 at 05:04 AM.
 
Old 08-21-2013, 11:15 AM   #21
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,342

Rep: Reputation: 184Reputation: 184
If I understand this right the hard drive that doesn't work has a small boot partition on sda1 and a Ubuntu root partition on sda3. If this is true reboot the bad hard drive and at the grub prompt try the following to see if it will boot.

Code:
grub rescue>  set prefix=(hd0,3)/boot/grub
grub rescue>  set root=(hd0,3)  
grub rescue>  insmod normal
grub rescue>  insmod linux  
grub rescue>  linux (hd0,3)/vmlinuz  root=/dev/sda3
grub rescue>  initrd (hd0,3)/initrd.img  
grub rescue>  boot
If so once inside run sudo install-grub and sudo update-grub to reinstall grub.

Last edited by colorpurple21859; 08-21-2013 at 11:26 AM.
 
Old 08-21-2013, 11:27 AM   #22
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,364
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
Quote:
Originally Posted by colorpurple21859 View Post
If I understand this right the hard drive that doesn't work has a small boot partition on sda1 and a Ubuntu root partition on sda3. If this is true reboot the bad hard drive and at the grub prompt try the following to see if it will boot.

Code:
set prefix=(hd0,3)/boot/grub
grub rescue>  set root=(hd0,3)  
grub rescue>  insmod normal
grub rescue>  insmod linux  
grub rescue>  linux (hd0,3)/vmlinuz  root=/dev/sda3
grub rescue>  initrd (hd0,3)/initrd.img  
grub rescue>  boot
If so once inside run sudo install-grub and sudo update-grub to reinstall grub.
This will only work if the filesystem on the /boot partition isn't corrupted, which sadly is the case here.
 
Old 08-21-2013, 11:33 AM   #23
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,342

Rep: Reputation: 184Reputation: 184
What I'm thinking is maybe the grub files got put on the root partition with what ever update that was done and the grub in the MBR is still looking for them in the boot partition. If this is true then this should work. I had something like this happen to me at one time.

Last edited by colorpurple21859; 08-21-2013 at 11:35 AM.
 
  


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
Speeding up LiveDVD boot, is it possible to get a list of files access on boot? MikeyCarter Linux - Software 1 11-17-2009 02:38 AM
Files are vanished in OEL 5.0 masatheesh Red Hat 8 12-03-2008 05:31 AM
how to recover Suse 11.0 /boot files if Ubuntu's grub lost them & can't boot to suse streams &dragonflies Suse/Novell 6 10-18-2008 08:17 PM
cd drive vanished / mdr boot is corupted / error 21 / help please! drjykellmrhyde Linux - Newbie 1 03-06-2008 08:13 AM
Boot Loader Vanished kurt165749 Linux - Software 7 05-01-2004 08:13 AM


All times are GMT -5. The time now is 01:26 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration