LinuxQuestions.org
Help answer threads with 0 replies.
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 01-20-2010, 06:15 PM   #1
palmweaver
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Rep: Reputation: 0
/dev/disk/by-id 'error'


I have cloned my linux OS onto a new hdd. Now even tho the system will boot, it directs me to the login screen and asks me to fix the location of the root dir because it is looking for /dev/disk/by-id with a very long serial #. I presume this is the old hdd serial #. How can I determine the serial # of the new hdd and change it in fstab? Is this the correct idea? Is it just......ls /dev/disk/by-id???
 
Old 01-20-2010, 06:29 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at "ls -l /dev/disk/by-id/". They are symbolic links to device nodes like /dev/sda1, /dev/sda2, etc.

Follow the links and use the new by-id names in /etc/fstab and /boot/grub/menu.lst.
The ID names are created by the kernel and contain the drive serial number, which changed. You may be able to globally replace the old drive serial number with the new one (e.g. in vim) leaving the rest of the id # entries the same (since you cloned the drive).
 
Old 01-24-2010, 09:31 PM   #3
palmweaver
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Fixed prob

Well, I didn't know that about the kernel. What I did was just delete all references to /dev/disk/by-id and replaced it in fstab with the actual location:

/dev/hda1 /dev/hda2 etc.

Then everything worked fine. Can you explain the advantage of leaving all the serial ## gobbledegook in fstab. It seems cleaner to me to just put the location. Maybe I can get a better result if I use the /dev/disk/by-id???

Thanks

Last edited by palmweaver; 01-24-2010 at 09:34 PM.
 
Old 04-22-2020, 11:58 AM   #4
saigelosli
LQ Newbie
 
Registered: Apr 2020
Posts: 1

Rep: Reputation: Disabled
I know this thread is like 10 years old now, but I think the answer is still relevant, and may help somebody...

The reason to use UUID or LABEL in your /etc/fstab is because device names can change over time. For instance, your boot volume may be /dev/sda1 when you set it up, but if you plug in a usb drive and reboot, the drive that contains your boot sector could become /dev/sdc1. Device name is assigned at boot time, and can change. Using UUID and LABEL can force the volume to be mounted where you want (and need) it.

Last edited by saigelosli; 04-22-2020 at 01:50 PM.
 
Old 04-22-2020, 01:04 PM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by saigelosli View Post
I know this thread is like 10 years old now, but I think the answer is still relevant, and may help somebody...

The reason to use UUID or LABEL in your /etc/fstab is because device names can change over time. For instance, your boot volume may be /dev/sda1 when you set it up, but if you plug in a usb drive and reboot, the drive that contains your boot sector could become /dev/sdc1. Device name is assigned at boot time, and can change. Using UUID and LABEL can force the drive to be mounted where you want (and need) it.
Depending on your chosen distribution, you're almost certainly able to label the boot partition (along with any others that you create during the installation process) and inform the installer to mount by label. That way, the /etc/fstab file that is created will have the "LABEL=" set up automatically. It's usually not available using a.) the "easy/quick" installation method or b.) the default method of building the filesystems and /etc/fstab---you might have to go to an "advanced" option when installing and laying out the filesystems. It's a pity since Linux's behavior changes device names depending on what's seen (and when) during the boot process. It's not just normal filesystems: you may note errors during the boot process that involved swap partitions that "moved" from naming changes. Fortunately, swap partitions can have labels, too. (And that `swapon' is smart enough to avoid mounting a regular filesystem as swap space.)

Cheers, all... Stay safe.
 
  


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
clone hard disk with: cat /dev/sda >/media/disk/backup deathalele Linux - Security 3 04-17-2009 12:29 AM
how to remove disk space in /dev/sda8 to increase the /dev/sda7 centguy Linux - Software 16 11-27-2008 06:05 PM
/dev/disk/by-uuid on install disk? randomsel Slackware 6 06-29-2008 08:54 AM
Move /dev/hda2 to end of disk and grow /dev/hda1 bcg121 Linux - Software 4 11-09-2007 09:51 PM
[SOLVED] system disk moves from /dev/sda to /dev/sdm gdevaucorbeil Linux - Hardware 4 03-10-2007 09:30 AM

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

All times are GMT -5. The time now is 02:50 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
Open Source Consulting | Domain Registration