LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-01-2013, 01:19 PM   #1
fredgrimes
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Rep: Reputation: Disabled
re-install mistake


Hey all,
I am new to linux and have had to re-install and initially created 3 partitions - root, swap and home - and when I had to reinstall i thought that rather than use the option to use entire disk I would try 'other' as I had stuf in my home directory that I wanted to keep.
I formatted the root partition but left home alone and installed the os,
When I rebooted the ther was nothing in my home directory at all.
So I checked gparted and it was showing /dev/sda1 as 43.57 gb and the rest after a small unallocated gap dev/sda3 extended, dev,sda5 swap and
dev/sda6 ext4 which I assume is my old home folder.
Is there any way to get that old home folder back?
I aqm using mint 15 cinnamon 64 bit and I didn't encrypt any folders
 
Old 10-01-2013, 01:45 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
It is pretty easy to get your /home back. Open the file /etc/fstab as root user in a text editor, for example with
Code:
sudo gedit /etc/fstab
Then add this line to the end:
Code:
/dev/sda6        /home                ext4        defaults         1   1
Now reboot the system and you should be fine.
 
Old 10-01-2013, 01:49 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Please post the output of "fdisk -l" as root/sudo to confirm, but it sounds like you told the installer to leave the old home partition alone, but didn't tell it to mount that partition anywhere. So now you have two home directories, the old one sitting on its own partition on sda6, and the new one sitting in a directory as part of / on sda1.

Migrating is easy, but you can't do it as your regular user. You'll need to enable the root account, log out as your regular user, and log in as root (either graphically, or preferably by using one of the Ctrl+Alt+F# consoles).

What you do from there is pretty straight forward. If there's nothing you need to save in this new home folder, then just delete everything inside of it, clean it out. Then you'll want to mount sda6 at /home. You should start by doing it manually, and once you verify everything is working you would add it to fstab to auto-mount on boot.

If you have any questions on any of these steps then feel free to ask. But before you start make sure you post the output of "fdisk -l", and it would be a good idea to mount sda6 somewhere and see what's inside to confirm it really is your old home directory before proceeding with the above steps.
 
Old 10-01-2013, 02:21 PM   #4
fredgrimes
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Unfortunately that didn't work
I think it may have been due to the fact that there weere 2 home directories
and when ~I tried to reboot it came up with an error asking me to log in as root
ass there was a problem ( sorry I didn't have a pen to write it down ) and when
i tried to log in it gave another error relating to the home directory and then said
could not update ice something.

Luckily I had renamed the original fstab file reather than overwriting it
here are the 2 fstabs:
original:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=21d6c514-35ce-4014-b7d3-4f78e588d480 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=f100f677-3a96-452b-a0ca-eb3800e099a3 none swap sw 0 0

and second one:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=21d6c514-35ce-4014-b7d3-4f78e588d480 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=f100f677-3a96-452b-a0ca-eb3800e099a3 none swap sw 0 0
/dev/sda6 /home ext4 defaults 1 1

I have just checked disks from the application menu and it shows the swap as in use but the old
home as not in use.

Ihave included screenshots from gparted and disk (hopefully the work)
Attached Thumbnails
Click image for larger version

Name:	disk.png
Views:	22
Size:	83.6 KB
ID:	13594   Click image for larger version

Name:	gparted.png
Views:	19
Size:	44.4 KB
ID:	13595  
 
Old 10-01-2013, 02:30 PM   #5
fredgrimes
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
suididaleggroll
Sorry I didn't the post you made

Here is the result of fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a304c

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 91371188 45684570+ 83 Linux
/dev/sda3 91373566 625141759 266884097 5 Extended
/dev/sda5 91373568 114808831 11717632 82 Linux swap / Solaris
/dev/sda6 114810880 625141759 255165440 83 Linux

Disk /dev/sdb: 16.0 GB, 16039018496 bytes
255 heads, 63 sectors/track, 1949 cylinders, total 31326208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 31326207 15662080 7 HPFS/NTFS/exFAT

Disk /dev/sdc: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4b57300

Device Boot Start End Blocks Id System
/dev/sdc1 63 625137344 312568641 7 HPFS/NTFS/exFAT

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
1 heads, 63 sectors/track, 31008336 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00d7bc16

Device Boot Start End Blocks Id System
/dev/sdd1 * 63 1953520127 976760032+ 7 HPFS/NTFS/exFAT
 
Old 10-01-2013, 02:58 PM   #6
fredgrimes
LQ Newbie
 
Registered: Oct 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
I have just noticed that for some reason if I plugin the usb thumb drive with the live image
of mint on it after I have already booted, the old home partition gets mounted as well.
Now I am really confused

Last edited by fredgrimes; 10-01-2013 at 03:08 PM. Reason: can't spell or punctuate
 
Old 10-01-2013, 03:15 PM   #7
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
I would probably do a reinstall if it were my case. But this time when is the time to set partitions select something else like you did before, and click on the existing partitions and choose where you wish them to be mounted and if you wish them to be formated.

select the root partition and choose it to be formate in ext4 and to be use for /
select your old home partition and choose no to be formated, select also to be mounted as /home
for swap the OS will pick it up imediatelly but you can click on it just to make sure.

proceed with the installation, all the settings you had from the previous installation should be there.

Good luck to you

Last edited by TroN-0074; 10-01-2013 at 03:16 PM.
 
Old 10-01-2013, 03:18 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by fredgrimes View Post
Unfortunately that didn't work
I think it may have been due to the fact that there weere 2 home directories
and when ~I tried to reboot it came up with an error asking me to log in as root
ass there was a problem ( sorry I didn't have a pen to write it down ) and when
i tried to log in it gave another error relating to the home directory and then said
could not update ice something.
May it be possible that you have chosen a different username for your new installation?
 
Old 10-01-2013, 07:30 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by TobiSGD View Post
May it be possible that you have chosen a different username for your new installation?
This is my guess, or the username was associated with a different UID in the new installation. There's nothing difficult amount migrating your /home onto another partition, I do it nearly every time I build a computer (I often set up a separate boot drive and RAID, install everything to / (boot drive) initially, then migrate /home onto the RAID after installation). It's really very straight forward, no need for re-installing the OS.

As I mentioned before, you should mount sda6 somewhere and verify its contents before attempting the migration. This will ensure everything looks the way you expect before you dive in head first with fstab and hope it works.

Get rid of that line you added to fstab, boot back into Mint, and run the following:
Code:
mkdir /mnt/oldhome
mount /dev/sda6 /mnt/oldhome
ls -l /mnt/oldhome
id
This will let you verify that the name and UID of your user in the new install matches what your old home partition expects.

Last edited by suicidaleggroll; 10-01-2013 at 07:33 PM.
 
  


Reply



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
made a mistake trying to install grub using tutorial.. tnewman1972 Linux - Software 3 01-16-2007 05:58 AM
Mistake on Mandriva Install in text login instead of GUI? gonzojd7 Mandriva 4 01-09-2006 05:49 PM
screwed up fedora install - dumb mistake itsjustme Fedora 2 06-19-2004 03:54 AM
grub-install /dev/hda1 = bad mistake? raedt Linux - General 4 08-17-2003 03:35 AM
Made mistake in install of Samba ikw38 Linux - Networking 0 07-09-2003 12:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:48 AM.

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
Open Source Consulting | Domain Registration