LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-03-2012, 12:37 AM   #1
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Question Remove partition sda5 from disk& edit fstab without losing boot capabilities


Sda 5 /home/previous_os is partition that existed from a previous install,which I backed up to my home partition, I recently deleted it & found my system unbootable.
I tried grub rescue from live-cd & found that I couldn't chroot to make necessary changes, nor, make changes from the grub prompt (inaddiquacies on my part), so, I recently installed anothe debian os & saved home to recover data after retrieving data I would like to remove the new sda5 & maintain my bootable system.
My intentions are to make all necessary changes to fstab &, or grub my google searches have not given me any light upon this matterm (making necessary changes before deleting partition on bootable linux system).
http://www.google.com/search?q=makin...a7a5ae9431d5a8
I have however found this thread but it's for a non-bootable system
http://www.kubuntuforums.net/showthr...-Grub2-related
Any hints as to which way I can proceed with partition removal?
 
Old 04-03-2012, 01:48 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
My first guess is that your root-system was on a partition after sda5.
Thing is, logical volumes (as all "partitions" above 4 are) change number if you add / remove partitions in front. Primary partitions don't, they always keep their number.
So if you have let's say sda5, sda6, sda7 and then remove partition sda5 - you end up with partitions sda5, sda6 (being the old sda6 & sda7).
If I'm right, all you need to do is to change a line in grub - could be done during boot.
You change "root=/dev/sda6" (or whatever number it was) to "root=/dev/sda5" (that is, one number lower than before).

If I'm not correct then please give complete partition layout, with info also about actice partition - which partition you boot from.
 
Old 04-03-2012, 08:07 AM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
My first guess is that your root-system was on a partition after sda5.
Yes , if I save home from previous installation my new install starts at sda6.
Quote:
Thing is, logical volumes (as all "partitions" above 4 are) change number if you add / remove partitions in front. Primary partitions don't, they always keep their number.
Yes the partition #'s changed.
Quote:
So if you have let's say sda5, sda6, sda7 and then remove partition sda5 - you end up with partitions sda5, sda6 (being the old sda6 & sda7).
If I'm right, all you need to do is to change a line in grub - could be done during boot.
At grub rescue prompt I couldn't figure out for the life of me how to proceed. Also my system uses UUID not sure if that makes a difference.
I tried this 1 & command failed at
Quote:
insmod (hdx,y)/boot/grub/linux.mod
I believe the error was command not found.
I 'm attaching my fstab as I plan on doing it again.
Code:
# / was on /dev/sda6 during installation
UUID=0af920e3-852d-429c-b0cb-65fc93c229f7 /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda11 during installation
UUID=62fa9d79-5fe2-420a-913b-e5ddea98231d /home           ext4    defaults        0       2
# /tmp was on /dev/sda10 during installation
UUID=af798ced-4a4d-4e94-9340-44edd54198a6 /tmp            ext4    defaults        0       2
# /usr was on /dev/sda7 during installation
UUID=40a5fc9d-88b1-47e8-9065-f0e0993c198b /usr            ext4    defaults        0       2
# /var was on /dev/sda8 during installation
UUID=fa3b428f-48f7-4f4e-9747-58007571a398 /var            ext4    defaults        0       2
# swap was on /dev/sda9 during installation
UUID=22243b45-cde4-48b5-9ec3-3aaff149b199 none            swap
It doesn't show sda5 which is my /home saved from previous install. Which I'd like to remove.
 
Old 04-03-2012, 08:25 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
/sbin/blkid (without any options or arguments) lists /dev/sd* with their UUID strings.

EDIT: including any not listed in fstab
 
Old 04-03-2012, 10:34 PM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Ok after getting data off home partition & deleting again I was able to delete the partition & rescue from the grub prompt using these 2 posts.
http://ubuntuforums.org/showpost.php...12&postcount=3

Last edited by EDDY1; 04-03-2012 at 10:57 PM.
 
Old 04-05-2012, 01:21 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
This thread is solved.
After using the above post & especially this 1, the last answer
http://superuser.com/questions/18173...hout-a-live-cd
I was able to recover & edit my /etc/fstab then do a
Quote:
grub install /dev/sda
now the system is bootable
Next item on my list of to do's is to learn how to recover from busy box

Last edited by EDDY1; 04-05-2012 at 01:23 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
Problem with boot CentOS 5 can't edit fstab ytd Linux - General 1 08-07-2009 05:02 PM
Re-install Kubuntu 8.10 without losing updates or disactivate/remove drivers&software 2ndchance Linux - Newbie 4 04-05-2009 12:20 AM
Edit fstab file to make USB disk writable. AGazzaz Linux - General 2 07-10-2008 05:18 PM
root partition full, cannot edit fstab rotezecke Linux - Newbie 14 02-13-2008 12:18 AM
USB HDD Mounting Problem "/dev/sda5 found in /etc/fstab" zcapx32 Linux - Hardware 5 06-30-2006 02:55 AM


All times are GMT -5. The time now is 05:13 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