Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
A problem that I encounter before. I think I did something wrong. My terminal suddenly turn to bash-4.2$. Almost all my folders are now empty.
I need your help please.
a couple of things to check:
- Are you logged in as a different user (or a different machine)?
- Did you delete your home directory?
- Is /home mounted?
The terminal string is set by the PS1 environment variable, which is usually populated by one of the shell start up scripts. The fact that it has not been set indicates that the normal start up scripts did not run correctly, possibly because they no longer exist.Do you remember what you were doing when this problem first occurred? Have you received any messages from Linux or from your BIOS indicating a potential hard disk problem? Any warning or error messages about mounting certain partitions on boot?
Can yiou please post the output of the following commands:
Code:
fdisk -l
cat /etc/fstab
mount
df -h
These will allow us to see what partitions are mounted and the state your hard drive is in.
Yes, I remember, I was running a program called wien2k in root, then instead of deleting a newly created directory, I did a mistake by deleting the home directory.
Code:
fdisk -l
PHP Code:
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 750.2 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 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: 0x00000000
Device Boot Start End Blocks Id System /dev/sda1 1 1465149167 732574583+ ee GPT Partition 1 does not start on physical sector boundary.
Disk /dev/mapper/vg_mohammed-lv_swap: 10.4 GB, 10435428352 bytes 255 heads, 63 sectors/track, 1268 cylinders, total 20381696 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: 0x00000000
Disk /dev/mapper/vg_mohammed-lv_swap doesn't contain a valid partition table
Disk /dev/mapper/vg_mohammed-lv_root: 53.7 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders, total 104857600 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: 0x00000000
Disk /dev/mapper/vg_mohammed-lv_root doesn't contain a valid partition table
Disk /dev/mapper/vg_mohammed-lv_home: 685.5 GB, 685483491328 bytes 255 heads, 63 sectors/track, 83338 cylinders, total 1338834944 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: 0x00000000
Disk /dev/mapper/vg_mohammed-lv_home doesn't contain a valid partition table
Code:
cat /etc/fstab
PHP Code:
# /etc/fstab # Created by anaconda on Mon Jul 1 22:44:04 2013 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/vg_mohammed-lv_root / ext4 defaults 1 1 UUID=ab72f7a2-7a91-455c-bd56-34904e00c04e /boot ext4 defaults 1 2 /dev/mapper/vg_mohammed-lv_home /home ext4 defaults 1 2 /dev/mapper/vg_mohammed-lv_swap swap swap defaults 0 0
Code:
mount
PHP Code:
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) devtmpfs on /dev type devtmpfs (rw,nosuid,size=4028244k,nr_inodes=1007061,mode=755) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) /dev/mapper/vg_mohammed-lv_root on / type ext4 (rw,relatime,data=ordered) tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime) debugfs on /sys/kernel/debug type debugfs (rw,relatime) tmpfs on /media type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755) configfs on /sys/kernel/config type configfs (rw,relatime) securityfs on /sys/kernel/security type securityfs (rw,relatime) mqueue on /dev/mqueue type mqueue (rw,relatime) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime) /dev/sda2 on /boot type ext4 (rw,relatime,stripe=4,data=ordered) /dev/mapper/vg_mohammed-lv_home on /home type ext4 (rw,relatime,data=ordered)
ls -al /home
total 12
drwxr-xr-x. 3 root root 4096 Jul 9 20:07 .
dr-xr-xr-x. 24 root root 4096 Jul 9 20:18 ..
drwx------. 18 mohammed mohammed 4096 Jul 9 20:19 mohammed
So it looks like your home directory exists. But it does not contain the files you expect?
But there is no l/home/lost+found directory as I would expect for a mounted ext4 file system. I wonder if you have mounted your home partition on a non-empty /home directory. Can you unmount /home and see if there is anything in /home ? You'll need to drop (or boot) to single user mode.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.