LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux Mint 15 xfce 32bit grub error+won't change file permissions or ownership (https://www.linuxquestions.org/questions/linux-newbie-8/linux-mint-15-xfce-32bit-grub-error-wont-change-file-permissions-or-ownership-4175512400/)

bta 07-27-2014 04:48 AM

Linux Mint 15 xfce 32bit grub error+won't change file permissions or ownership
 
Hello all,

I have been using my LM15 xfce for a couple of months on my Acer Aspire E1-531 laptop now and I like it a lot.
And now, it has just collapsed and I am not really sure what has happened.
2 days ago, the pendrive (8GB) I had bought from eBay arrived and I tried to copy files to it. The system popped up an error message saying something about not liking the name of the device, so I took the brand new pendrive to my wife's Win7 laptop and formatted it.
Even then, when I again tried to copy files, LM gave me some error message about one of the files but copied the other files nicely. And next morning (yesterday), when I wanted to turn on my laptop it said this:
error: unknown filesystem
grub rescue>


I know a little about computers as a user and I have learned that there's a lot of help available out there, so I started googling and have found a lot of resources.

I couldn't restore Grub using the methods suggested on youtube, so I took out the liveCD and started to run LM from there.

First, I thought I should try to restore Grub and get back the system so I downloaded Boot Repair and ran it.
Pls see my results at http://paste.ubuntu.com/7869527
As you will see, I have 1 HDD and an external WD drive.

fdisk -l gives this:
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 / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0007c874

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 621318143 310658048 83 Linux
/dev/sda2 621320190 625141759 1910785 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5 621320192 625141759 1910784 82 Linux swap / Solaris

Disk /dev/sdb: 2000.4 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907024896 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: 0x00050fb0

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


As Boot Repair didn't help, I started concentrating on getting my files out as I have my whole company data in this computer (and I haven't done any backup lately - I know: what an idiot...) so, I tried to reach sda1 from the LiveCD session.

I tried to mount sda1 by:
sudo mount /dev/sda1 /mnt
and it said: "you must specify a filesystem" (or something to that effect - I am writing this from memory)

So I kept googling and I discovered I can repair the filesystem with the fsck command. I ran it and it gave me a ton of error messages offering the option of repairing them by pressing y, which I did everytime. In the end, I could mount the sda1 and I could get to my folders using File Manager.
However, many of the files and folders were locked and the system did not allow me permission to copy them.

Another round of googling and I found out that I can change the permissions and/or the ownership of the files and directories. For the sake of simplicity, I thought I would change the permissions to every file and directory as my only goal was to salvage my files before a complete overhaul, so I typed:
sudo chmod -R 777 /dev/sda
As I have got the prompt back, I thought it was done but nothing has changed.

Then I tried to change the ownership of the files typing:
sudo chown -R bta /dev/sda1 being bta is my username. I got this:
chown: invalid user: ‘bta’

Hmmm... So, I wanted to see a list of users. Following google, I typed:
cat /etc/passwd |grep "/home" |cut -d: -f1
And I got:
syslog
usbmux
saned
mint


I figured the user 'mint' would be the liveCD session user, so I typed:
sudo chown -R mint /dev/sda1
Again, I got the prompt back, so I thought it was done and now I can copy my files but I was wrong. The files are still locked and the owner is a user called '1000'. This is shown when I right-click the file and go to Properties>Permissions.

Now, I have no idea what is this user or how to get out of this situation.
I only want to get my files out into my external drive so that I can do a clean slate and build the system again.

I have no idea what went wrong and I am doing things I do not fully understand and that worries me.

Could you please help me what to do with this? I would highly appreciate it as my whole life is in here and I need the files badly.

Thx a lot in advance and sorry for the long post.

Have a great day!
Attila

yancek 07-27-2014 08:04 AM

A problem we will have in trying to help is that you did not make note of the exact errors so we don't know what they are. Knowing that will often lead to someone being able to give a solution more easily.

The mount command you should use: sudo mount -t ext4 /dev/sda1 /mnt

You need sudo as you can't mount without root/admin privileges, the -t is for filesystem type and ext4 is the default filesystem type for Mint 15. You don't need to change the permissions you need to copy the files as the root user, use sudo prior to the command.

User 1000 is the user you created on Mint, the installed Mint. If you can mount sda1, you should be able to copy file FROM it without privileges but NOT TO it, which you don't want to anyway. Where are you planning to copy them to? Your 2TB drive has only one partition and that has a windows filesystem.

Quote:

Mounting failed: mount: unknown filesystem type ''
The message above is probably pointing to the source of the problem. That's your Mint partition and should be shown, probably as ext4. Also, the bootinfoscript output isn't complete, for one thing there is no grub.cfg file which is the boot menu. You might try running it again from the Mint CD. Some info on the error messages would be helpful. I think you jumped the gun trying to repair the filesystem as when you got the warning that you needed to indicate the filesystem type, that's all you needed to do not run fsck.

bta 07-27-2014 11:05 AM

Hi Yancek, thx a lot for the reply.

I am trying to understand what you say and it is a challenge for me, so sorry.
You see, I am used to the graphical tools used in Win and I have always had difficulties with terminal commands and their syntax. Plus, this is not my first language and so I have to get familiar with the technical terms as well...

I understand from what you say that I should run the grub.cfg file from the liveCD but I have no idea how to do that.
It would be good if that would give me my old system back but how can I do that?

I used the mount command you quoted and again, I got the cursor back, so I guess it is done. I try to change directories by typing:
cd /sda1
and it says:
bash: cd: /sda1: No such file or directory

I guess I gave the wrong command...

But I turned on File Manager (the graphical tool :) ) and I can still not copy the files. But then, I don't know how to get sudo rights in the graphical tool and that could be the problem.

And yes, the only place I can copy them would be the WD external drive which has Win partitions (I don't know how) but I only want to keep them there as long as I can copy them back.

I would copy the error messages here for you to help you help me and it's so kind of you really, but there have been so many error messages I really don't know which one to copy. Plus I can only go back as far as the terminal lets me to and that is not the beginning of this day...

And as I am having doubts about the integrity of the present system - having been corrupted just like that, I was thinking the best would be to do a complete overhaul. It is just that I need to get my files out first but I don't get the permission in the graphical tool (File Manager) and I don't know how to do it in terminal.

Thx again and pls tell me what information to give you and I will.
Attila

EDDY1 07-27-2014 11:53 AM

sdb is a 2TB drive is it full?
If not resize it & make room for LM.
Install LM to free space
Boot it & mount sda it's much easier than running all the mount commands.
You will also be able to run fsck from it also.

I keep debian on an external drive just for this situation. Also you can run "update-grub & add it to your new bootloader.

yancek 07-27-2014 12:58 PM

Quote:

I understand from what you say that I should run the grub.cfg file from the liveCD but I have no idea how to do that.
No. What I said is that the link you posted to the boot repair output did not contain any grub.cfg file. That is the boot menu file shown on boot if the system is working. That file is usually included with the other information you posted. It is not in yours, I don't know why but that sometimes happens. You could try just running it again without trying to make any repairs.

Quote:

cd /sda1
Wrong command. It should be: cd /mnt/

I'm not sure what the filemanager is on Mint xfce. I found a site that indicated it was thunar so if that is the case from the Mint CD booted, open a terminal and type: sudo thunar That should open the filemanager with root privileges so you can copy. I don't know if the windows partition on sdb1 (2TB drive) is mounted. You could take a look under the /media directory from Mint. If not you would have to create a mount point and mount it with a command similar to above:

sudo mkdir /mnt/sdb1
sudo mount -t ntfs /dev/sdb1 /mnt/sdb1

I don't use windows much and don't copy files from one filesystem to another so I don't know if that will create problems. Someone else should have more knowledge about that and tell you if you need to shrink sdb1 and create space with a Linux filesystem to copy the files to.

bta 07-27-2014 01:05 PM

Hello EDDY, thx for your thoughts.
I think I still have about 180GB free space on the external drive and I believe I could free up some more. But I don't know how to resize it. What does that mean?

Also, how do I run update/grub?
I remember doing something like that yesterday (I was following some advice given to someone in a different topic somewhere - and I can't recall the command) but it did not help...

Quote:

Originally Posted by EDDY1 (Post 5210338)
sdb is a 2TB drive is it full?
If not resize it & make room for LM.
Install LM to free space
Boot it & mount sda it's much easier than running all the mount commands.
You will also be able to run fsck from it also.

I keep debian on an external drive just for this situation. Also you can run "update-grub & add it to your new bootloader.


bta 07-27-2014 01:38 PM

Thx Yancek,
The sudo thunar worked... :)

I can't tell you how relieved I am! Thx a lot for your kind help and advice, now I will rebuild the whole system.

The question stays, however, about how this all started, so that I can avoid getting here again. I was particularly alarmed seeing that my username had disappeared.

Is this common that such file corruptions happen?
Anyway, I know that from now on I will backup my files regularly, this was a good lesson.

Thx for everything, guys, I am truly grateful.
Have a wonderful evening!
Attila

EDDY1 07-27-2014 03:44 PM

Quote:

I think I still have about 180GB free space on the external drive and I believe I could free up some more
180 would've been excessive for an Os just for rescue, but it would've been determined by how much data you wanted to copy to it.
Anyways congrats on solving problem. Mark thread as Solved using the "Thread Tools" option above.

yancek 07-27-2014 06:42 PM

Quote:

The system popped up an error message saying something about not liking the name of the device, so I took the brand new pendrive to my wife's Win7 laptop and formatted it.
The 'name' or label? Unless you got some other warning I would not have done anything. Hard to say what that was all about but the lesson here is always right down any warnings/errors you get or copy them to a file. Better to have the information and not need it than to need it an not have it. Formatting is a pretty extreme measure and I'm not really sure why you did that. I also don't see how formatting your flash would have affected the system on your hard drive. Need to be very careful when you are working with partitions and formatting. If you are not sure, STOP.

Quote:

I was particularly alarmed seeing that my username had disappeared.
I doubt that it did. It can show as 1000 from a Live CD and when you boot the system on the drive it will show the actual user name, at least that has been my experience. The same thing happens when you access a Linux system from another installed Linux system.

Something else must have happened to corrupt your Grub. Trying to copy files from an installed system to a flash drive isn't in itself going to have any impact on booting. There are endless possibilities as to how that might have happened. At least you have it working now.

bta 07-28-2014 02:11 AM

I formatted the memory stick to see that it is not an extended one as sometimes people are sold these who think they are buying a proper one.
I have never had any problems with memory sticks before and this one had just arrived, so I thought that I might have purchased a faulty or a rigged piece.

But, you are right again, I will write down all the warnings and other messages I get from the system from now on. I used to do it, but then, as LM was so reliable, I have just got lazy with these. Now I know I can't afford that luxury... and also to backup my files every week or even twice a week.

And the most interesting part is that once I copied my files into the external drive I restarted the computer. Upon booting, it presented me the Grub menu, I chose the first option (the normal boot) and since then everything is working perfectly as it used to...

I have learned throughout the years that there is no point in always seeking to understand why is something happening the way it does, so I just shrug my shoulders now. Last night, I downloaded the iso of LM 17 xfce and will do a complete overhaul during the day.

Anyway, I do appreciate your kind help and support.
I hope I can be of similar help to you or someone in the near future.
Thx for everything and have a great day!
Attila


All times are GMT -5. The time now is 07:17 AM.