LinuxQuestions.org
Visit Jeremy's Blog.
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 07-01-2013, 10:54 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 732

Rep: Reputation: Disabled
Mounting hard drive from Linux Live CD


Did something stupid, and messed up my /etc/fstab by putting barrier=0 as an option to to my root directory. So, I booted from a Linux Live CD. My Linux distributor is Centos.

Did fdisk -l, and see /dev/sda being 1500 GB and assume it is my HD. It shows /dev/sda1 (which evidently does not end on cylinder boundary), and /dev/sda2. It also shows /dev/dm-0 and /dev/dm-1, and says both do not contain a valid partition type.

I mount sda1, and think it is the /boot of my hard drive, and cannot get to /etc/fstab and fix it.

I then try to mount sda2, but get "mount: /dev/sda2 already mounted or /mnt/sda busy". So, I try to umount /dev/sda2, but am told it is not mounted.

I then do mount, and see /dev/mapper/live-rw (the CD), /proc, /sys, /dev/pts, /dev/shm, and /proc/sys/fs/binfmt_misc. No sda2.

Can anyone help?

Last edited by NotionCommotion; 07-01-2013 at 11:09 AM.
 
Old 07-01-2013, 11:10 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,473

Rep: Reputation: Disabled
I believe CentOS uses LVM for the root partition. Try mounting one of the /dev/dm-n devices.
 
Old 07-01-2013, 11:17 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 732

Original Poster
Rep: Reputation: Disabled
Thank you!!!

dm0 is my hard drive and dm1 is I think the CD.

Other than asking, how should I have known this?

PS. Can't edit fstab cause I don't have vi. Shouldn't be too hard to get...
 
Old 07-01-2013, 11:22 AM   #4
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 732

Original Poster
Rep: Reputation: Disabled
upon further review, dm-0 and dm-1 are both the CD. dm-0 is r/w and dm-1 is r only.

How do I access sda2?

Thanks
 
Old 07-01-2013, 04:24 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,169

Rep: Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562
Use another live cd. Fedora ought to mount the local disks or you may have to say mount read as. Many other live cd's ought to be able to edit this file. The hard drive's data shouldn't affect how a live cd mounts it.

In almost every live cd, you can add in tools from network just like a normal install. KDE stuff ought to have kate or vi vim by default I'd think.
 
Old 07-01-2013, 07:16 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Have you got the install media for your Centos? I always boot off that and select Rescue mode.
All the tools you need are there.
 
Old 07-03-2013, 07:09 AM   #7
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 732

Original Poster
Rep: Reputation: Disabled
Thanks jefro and chrism01,

I ended up successfully using the original install media, but since it was a url upload, it was a bit of a pain.

I will probably end up creating a new lives cd.
 
  


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
Mounting Hard drive on Ubuntu Live Cd humble Linux - Newbie 4 06-21-2007 07:19 PM
mounting hard drive from live CD? ocicat Ubuntu 2 06-01-2007 03:03 AM
Help with mounting external hard drive in linux wearetheborg Linux - Hardware 6 12-29-2006 04:31 PM
Mounting old Linux hard drive Ionexchange Linux - Hardware 4 06-12-2004 12:13 AM

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

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