public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] ext3 with errors
@ 2007-09-29 18:32 Arnau Bria
  2007-09-29 21:56 ` Neil Bothwick
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Arnau Bria @ 2007-09-29 18:32 UTC (permalink / raw
  To: gentoo-user

Hi,

My system runs on several ext3 partitions. Last times I restart it, it
has fs errors, so I have to fsck it.
Now, I have a new disk and I want to set a RAID1, but first, I'm
wondering what to do to save my fs consistency. So, I want to copy data
from old disk to new disk, but I'm not sure if I must do a cp -a or a
dd. I mean, if I do a cp -a my new disk will have a new journaling, and
if I do a dd, new disk will have same. Am I right? What do you
recommend?

And, following with this, any guide to configure a RAID1 with a system
already installed? 

TIA,
Arnau
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-29 18:32 [gentoo-user] ext3 with errors Arnau Bria
@ 2007-09-29 21:56 ` Neil Bothwick
  2007-10-01 18:52   ` Arnau Bria
  2007-09-30  3:47 ` Mark Shields
  2007-09-30 10:47 ` Florian Philipp
  2 siblings, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2007-09-29 21:56 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

Hello Arnau Bria,

> Now, I have a new disk and I want to set a RAID1, but first, I'm
> wondering what to do to save my fs consistency. So, I want to copy data
> from old disk to new disk, but I'm not sure if I must do a cp -a or a
> dd. I mean, if I do a cp -a my new disk will have a new journaling, and
> if I do a dd, new disk will have same. Am I right? What do you
> recommend?

Create a two disk RAID1 using only your existing disk, marking the other
disk missing. Then add your new disk and the RAID will automatically
update it from the first disk.


-- 
Neil Bothwick

Religious error: (A)tone, (R)epent, (I)mmolate?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-29 18:32 [gentoo-user] ext3 with errors Arnau Bria
  2007-09-29 21:56 ` Neil Bothwick
@ 2007-09-30  3:47 ` Mark Shields
  2007-09-30 10:47 ` Florian Philipp
  2 siblings, 0 replies; 11+ messages in thread
From: Mark Shields @ 2007-09-30  3:47 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

On 9/29/07, Arnau Bria <arnau@emergetux.net> wrote:
>
> Hi,
>
> My system runs on several ext3 partitions. Last times I restart it, it
> has fs errors, so I have to fsck it.
> Now, I have a new disk and I want to set a RAID1, but first, I'm
> wondering what to do to save my fs consistency. So, I want to copy data
> from old disk to new disk, but I'm not sure if I must do a cp -a or a
> dd. I mean, if I do a cp -a my new disk will have a new journaling, and
> if I do a dd, new disk will have same. Am I right? What do you
> recommend?
>
> And, following with this, any guide to configure a RAID1 with a system
> already installed?
>
> TIA,
> Arnau
> --
> gentoo-user@gentoo.org mailing list
>
>
Is it software or hardware RAID 1?  Hardware RAID 1 is easy, at least for a
motherboard I used that had a Silicon Image chipset.  I just told it to
build a RAID 1 mirror with the two disks, it created an exact copy then and
there of the original.  From then on in wrote to the 2nd drive whenever it
wrote to the 1st one.

-- 
- Mark Shields

[-- Attachment #2: Type: text/html, Size: 1420 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-29 18:32 [gentoo-user] ext3 with errors Arnau Bria
  2007-09-29 21:56 ` Neil Bothwick
  2007-09-30  3:47 ` Mark Shields
@ 2007-09-30 10:47 ` Florian Philipp
  2007-09-30 11:54   ` Dale
  2 siblings, 1 reply; 11+ messages in thread
From: Florian Philipp @ 2007-09-30 10:47 UTC (permalink / raw
  To: gentoo-user

Arnau Bria schrieb:
> Hi,
> 
> My system runs on several ext3 partitions. Last times I restart it, it
> has fs errors, so I have to fsck it.
> Now, I have a new disk and I want to set a RAID1, but first, I'm
> wondering what to do to save my fs consistency. So, I want to copy data
> from old disk to new disk, but I'm not sure if I must do a cp -a or a
> dd. I mean, if I do a cp -a my new disk will have a new journaling, and
> if I do a dd, new disk will have same. Am I right? What do you
> recommend?
> 
> And, following with this, any guide to configure a RAID1 with a system
> already installed? 
> 
> TIA,
> Arnau

Just a small note: When you are using cp -a, keep in mind that something 
like cp -a /home/user/* doesn't fetch files and folders that are hidden 
(for example .vimrc). I've lost all my settings that way when I migrated 
my /home :(
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-30 10:47 ` Florian Philipp
@ 2007-09-30 11:54   ` Dale
  2007-09-30 12:34     ` Florian Philipp
  0 siblings, 1 reply; 11+ messages in thread
From: Dale @ 2007-09-30 11:54 UTC (permalink / raw
  To: gentoo-user

Florian Philipp wrote:
> Arnau Bria schrieb:
>> Hi,
>>
>> My system runs on several ext3 partitions. Last times I restart it, it
>> has fs errors, so I have to fsck it.
>> Now, I have a new disk and I want to set a RAID1, but first, I'm
>> wondering what to do to save my fs consistency. So, I want to copy data
>> from old disk to new disk, but I'm not sure if I must do a cp -a or a
>> dd. I mean, if I do a cp -a my new disk will have a new journaling, and
>> if I do a dd, new disk will have same. Am I right? What do you
>> recommend?
>>
>> And, following with this, any guide to configure a RAID1 with a system
>> already installed?
>> TIA,
>> Arnau
>
> Just a small note: When you are using cp -a, keep in mind that
> something like cp -a /home/user/* doesn't fetch files and folders that
> are hidden (for example .vimrc). I've lost all my settings that way
> when I migrated my /home :(


That's odd, mine does.  That's what I use to do back-ups on my system
and it get all the .* files and directories.  I have my back-up mounted
at /mnt/gentoo and this is a list of my root user directory:

root@smoker / # ls -al /mnt/gentoo/root/
total 1128
drwx------ 29 root root   4096 2007-09-29 00:54 .
drwxr-xr-x 15 root root   4096 2007-09-29 01:26 ..
-rw-------  1 root root  11467 2007-09-27 15:15 .bash_history
-rw-r--r--  1 root root     11 2006-10-01 21:39 .bash_login
-rw-r--r--  1 root root     11 2006-10-01 21:39 .bash_logout
drwx------  2 root root   4096 2007-05-03 07:21 .ccache
-rwxr-xr-x  1 root root   4487 2004-05-10 07:37 CFLAGS-script
-rw-r--r--  1 root root  40304 2007-01-08 04:21 config
drwx------  3 root root   4096 2007-03-18 06:11 .config
-rw-r--r--  1 root root  43453 2007-06-25 23:09 config-2-6-20-r8
-rwxr-xr-x  1 root root   1045 2006-11-18 03:07 cruft.removal
-rw-r--r--  1 root root    279 2005-12-20 13:57 dalek.revoke
-rw-r--r--  1 root root   1360 2007-08-29 06:38 Data.kdar
-rw-r--r--  1 root root     55 2007-09-27 17:47 .DCOPserver_smoker__0
lrwxrwxrwx  1 root root     27 2007-09-29 00:54 .DCOPserver_smoker_:0 ->
/root/.DCOPserver_smoker__0
-rw-r--r--  1 root root  32520 2007-04-10 03:16 dead.letter
drwx------  2 root root   4096 2007-09-09 04:50 Desktop
drwxr-xr-x  3 root root   4096 2007-01-19 04:56 .distcc
-rwxr-xr-x  1 root root  10213 2006-09-04 04:03 elog
-rwxr-xr-x  1 root root   3011 2006-10-30 03:25 elog-list
-rw-r--r--  1 root root    877 2006-09-10 15:38 emerge-script
drwxr-xr-x  2  500  500   4096 2005-07-18 15:59 enotice-0.2.9.1_alpha
-rwxr-xr-x  1 root root  25347 2006-04-20 22:46 etc-portclean
-rwxr-xr-x  1 root root    768 2006-10-20 01:52 fahback
-rwxr-xr-x  1 root root 153361 2006-10-18 01:43 finstall4.9
drwxr-xr-x  3 root root   4096 2006-10-20 01:52 foldingathome
-rw-r--r--  1 root root    854 2007-01-29 17:41 .fonts.cache-1
-rwxr-xr-x  1 root root   1256 2006-08-22 00:12 fragck.pl
drwx------  2 root root   4096 2007-08-07 13:45 .gconf
drwx------  2 root root   4096 2007-08-07 13:59 .gconfd
-rwxr-xr-x  1 root root   8240 2006-09-05 18:50 genscript.sh
drwxr-xr-x 21 root root   4096 2007-09-18 22:41 .gimp-2.2
drwx------  3 root root   4096 2006-12-09 14:17 .gnome2
drwx------  2 root root   4096 2006-12-09 14:17 .gnome2_private
drwx------  2 root root   4096 2006-12-11 22:51 .gphoto
drwxr-xr-x  2 root root   4096 2006-11-29 00:49 .gstreamer-0.8
-rw-r--r--  1 root root     67 2007-09-23 21:34 .hplip.conf
-rw-r--r--  1 root root    544 2007-07-31 06:58 .htoprc
-rw-------  1 root root   2284 2007-09-27 17:47 .ICEauthority
drwx------  3 root root   4096 2006-11-27 00:03 .kde
-rw-r--r--  1 root root      0 2006-08-03 09:23 .keep
-rw-------  1 root root     35 2007-07-30 04:05 .lesshst
drwx------  3 root root   4096 2006-09-14 04:03 .local
drwx------  3 root root   4096 2007-09-18 22:15 .macromedia
drwxr-xr-x  3 root root   4096 2006-09-14 04:04 .mcop
-rw-------  1 root root     31 2007-09-28 04:16 .mcoprc
-rw-r--r--  1 root root     35 2007-06-03 00:18 minicom.log
drwx------  3 root root   4096 2006-12-17 02:37 .mozilla
drwxr-xr-x  2 root root   4096 2007-06-13 13:15 .mplayer
drwx------  3 root root   4096 2007-08-18 17:48 .ooo-2.0
-rwxr-xr-x  1 root root  23540 2004-05-10 08:20 prune-script
drwxr-xr-x  2 root root   4096 2006-09-13 22:51 .qt
-rw-------  1 root root  14491 2007-09-18 22:41 .recently-used
-rwxr-xr-x  1 root root  31133 2007-05-02 13:18 recompile-remaining-packages
drwxr-xr-x  2 root root   4096 2007-05-12 23:00 rep4.py
-rw-r--r--  1 root root   1232 2007-09-26 02:06 .revdep-rebuild.0_env
-rw-r--r--  1 root root 377327 2007-09-26 02:06 .revdep-rebuild.1_files
-rw-r--r--  1 root root  18877 2007-09-26 02:06 .revdep-rebuild.2_ldpath
-rw-r--r--  1 root root    105 2007-09-26 02:10 .revdep-rebuild.3_rebuild
-rw-r--r--  1 root root     20 2007-09-26 02:10 .revdep-rebuild.4_ebuilds
-rw-r--r--  1 root root      2 2007-09-26 02:10 .revdep-rebuild.5a_status
-rw-r--r--  1 root root      2 2007-09-26 02:10 .revdep-rebuild.5b_status
-rw-r--r--  1 root root     20 2007-09-26 02:10 .revdep-rebuild.5_order
-rw-r--r--  1 root root      2 2007-09-26 02:10 .revdep-rebuild.6_status
-rw-r--r--  1 root root    157 2006-12-13 18:09 .screenrc
-rw-r--r--  1 root root      2 2006-12-13 18:09 .screenrc~
drwxr-xr-x  3 root root   4096 2006-10-02 20:13 .scribus
-rwxr-xr-x  1 root root  39712 2004-08-15 08:05 server.save
drwx------  2 root root   4096 2007-06-26 00:45 .ssh
drwx------  3 root root   4096 2007-09-29 00:53 .thumbnails
-rwxr-xr-x  1 root root    506 2006-05-17 19:39 USE-vaild-script
-rw-r--r--  1 root root   1329 2007-08-29 05:25 Wallpapers.kdar
drwxr-xr-x  2 root root   4096 2006-12-22 02:53 .wireshark
-rw-------  1 root root     51 2007-06-26 23:16 .xauthClejoT
-rw-------  1 root root     51 2007-06-26 16:43 .xauthHe7jsL
-rw-------  1 root root     51 2007-04-10 01:08 .xauthhYnCuf
-rw-------  1 root root     51 2006-12-27 17:19 .xauthiFJTYh
-rw-------  1 root root     51 2007-09-06 03:32 .xauthIQEJV1
-rw-------  1 root root     51 2007-09-27 19:04 .xauthiXectC
-rw-------  1 root root     51 2007-09-28 15:13 .xauthmpYx4r
-rw-------  1 root root      0 2006-09-13 10:10 .Xauthority
-rw-------  1 root root     51 2007-03-04 13:15 .xauthpdEPUu
-rw-------  1 root root     51 2006-12-27 17:19 .xauthQ1QG5o
-rw-------  1 root root     51 2007-03-18 23:21 .xauthvUHiuD
-rw-------  1 root root     51 2007-09-27 17:47 .xauthWrAMse
-rw-------  1 root root     51 2007-03-02 11:02 .xauthyTPJ6s
drwxr-xr-x  2 root root   4096 2007-07-17 23:44 .xine
root@smoker / # 

Ideas on why mine does and yours doesn't??

Dale

:-)  :-) 
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-30 11:54   ` Dale
@ 2007-09-30 12:34     ` Florian Philipp
  2007-09-30 13:11       ` Etaoin Shrdlu
  0 siblings, 1 reply; 11+ messages in thread
From: Florian Philipp @ 2007-09-30 12:34 UTC (permalink / raw
  To: gentoo-user

Dale schrieb:
> Florian Philipp wrote:
>> Arnau Bria schrieb:
>>> Hi,
>>>
>>> My system runs on several ext3 partitions. Last times I restart it, it
>>> has fs errors, so I have to fsck it.
>>> Now, I have a new disk and I want to set a RAID1, but first, I'm
>>> wondering what to do to save my fs consistency. So, I want to copy data
>>> from old disk to new disk, but I'm not sure if I must do a cp -a or a
>>> dd. I mean, if I do a cp -a my new disk will have a new journaling, and
>>> if I do a dd, new disk will have same. Am I right? What do you
>>> recommend?
>>>
>>> And, following with this, any guide to configure a RAID1 with a system
>>> already installed?
>>> TIA,
>>> Arnau
>> Just a small note: When you are using cp -a, keep in mind that
>> something like cp -a /home/user/* doesn't fetch files and folders that
>> are hidden (for example .vimrc). I've lost all my settings that way
>> when I migrated my /home :(
> 
> 
> That's odd, mine does.  That's what I use to do back-ups on my system
> and it get all the .* files and directories.  I have my back-up mounted
> at /mnt/gentoo and this is a list of my root user directory:
> 
> root@smoker / # ls -al /mnt/gentoo/root/
> total 1128
> drwx------ 29 root root   4096 2007-09-29 00:54 .
> drwxr-xr-x 15 root root   4096 2007-09-29 01:26 ..
> -rw-------  1 root root  11467 2007-09-27 15:15 .bash_history
> -rw-r--r--  1 root root     11 2006-10-01 21:39 .bash_login
> -rw-r--r--  1 root root     11 2006-10-01 21:39 .bash_logout
> drwx------  2 root root   4096 2007-05-03 07:21 .ccache
> -rwxr-xr-x  1 root root   4487 2004-05-10 07:37 CFLAGS-script
> -rw-r--r--  1 root root  40304 2007-01-08 04:21 config
> drwx------  3 root root   4096 2007-03-18 06:11 .config
> -rw-r--r--  1 root root  43453 2007-06-25 23:09 config-2-6-20-r8
> -rwxr-xr-x  1 root root   1045 2006-11-18 03:07 cruft.removal
> -rw-r--r--  1 root root    279 2005-12-20 13:57 dalek.revoke
> -rw-r--r--  1 root root   1360 2007-08-29 06:38 Data.kdar
> -rw-r--r--  1 root root     55 2007-09-27 17:47 .DCOPserver_smoker__0
> lrwxrwxrwx  1 root root     27 2007-09-29 00:54 .DCOPserver_smoker_:0 ->
> /root/.DCOPserver_smoker__0
> -rw-r--r--  1 root root  32520 2007-04-10 03:16 dead.letter
> drwx------  2 root root   4096 2007-09-09 04:50 Desktop
> drwxr-xr-x  3 root root   4096 2007-01-19 04:56 .distcc
> -rwxr-xr-x  1 root root  10213 2006-09-04 04:03 elog
> -rwxr-xr-x  1 root root   3011 2006-10-30 03:25 elog-list
> -rw-r--r--  1 root root    877 2006-09-10 15:38 emerge-script
> drwxr-xr-x  2  500  500   4096 2005-07-18 15:59 enotice-0.2.9.1_alpha
> -rwxr-xr-x  1 root root  25347 2006-04-20 22:46 etc-portclean
> -rwxr-xr-x  1 root root    768 2006-10-20 01:52 fahback
> -rwxr-xr-x  1 root root 153361 2006-10-18 01:43 finstall4.9
> drwxr-xr-x  3 root root   4096 2006-10-20 01:52 foldingathome
> -rw-r--r--  1 root root    854 2007-01-29 17:41 .fonts.cache-1
> -rwxr-xr-x  1 root root   1256 2006-08-22 00:12 fragck.pl
> drwx------  2 root root   4096 2007-08-07 13:45 .gconf
> drwx------  2 root root   4096 2007-08-07 13:59 .gconfd
> -rwxr-xr-x  1 root root   8240 2006-09-05 18:50 genscript.sh
> drwxr-xr-x 21 root root   4096 2007-09-18 22:41 .gimp-2.2
> drwx------  3 root root   4096 2006-12-09 14:17 .gnome2
> drwx------  2 root root   4096 2006-12-09 14:17 .gnome2_private
> drwx------  2 root root   4096 2006-12-11 22:51 .gphoto
> drwxr-xr-x  2 root root   4096 2006-11-29 00:49 .gstreamer-0.8
> -rw-r--r--  1 root root     67 2007-09-23 21:34 .hplip.conf
> -rw-r--r--  1 root root    544 2007-07-31 06:58 .htoprc
> -rw-------  1 root root   2284 2007-09-27 17:47 .ICEauthority
> drwx------  3 root root   4096 2006-11-27 00:03 .kde
> -rw-r--r--  1 root root      0 2006-08-03 09:23 .keep
> -rw-------  1 root root     35 2007-07-30 04:05 .lesshst
> drwx------  3 root root   4096 2006-09-14 04:03 .local
> drwx------  3 root root   4096 2007-09-18 22:15 .macromedia
> drwxr-xr-x  3 root root   4096 2006-09-14 04:04 .mcop
> -rw-------  1 root root     31 2007-09-28 04:16 .mcoprc
> -rw-r--r--  1 root root     35 2007-06-03 00:18 minicom.log
> drwx------  3 root root   4096 2006-12-17 02:37 .mozilla
> drwxr-xr-x  2 root root   4096 2007-06-13 13:15 .mplayer
> drwx------  3 root root   4096 2007-08-18 17:48 .ooo-2.0
> -rwxr-xr-x  1 root root  23540 2004-05-10 08:20 prune-script
> drwxr-xr-x  2 root root   4096 2006-09-13 22:51 .qt
> -rw-------  1 root root  14491 2007-09-18 22:41 .recently-used
> -rwxr-xr-x  1 root root  31133 2007-05-02 13:18 recompile-remaining-packages
> drwxr-xr-x  2 root root   4096 2007-05-12 23:00 rep4.py
> -rw-r--r--  1 root root   1232 2007-09-26 02:06 .revdep-rebuild.0_env
> -rw-r--r--  1 root root 377327 2007-09-26 02:06 .revdep-rebuild.1_files
> -rw-r--r--  1 root root  18877 2007-09-26 02:06 .revdep-rebuild.2_ldpath
> -rw-r--r--  1 root root    105 2007-09-26 02:10 .revdep-rebuild.3_rebuild
> -rw-r--r--  1 root root     20 2007-09-26 02:10 .revdep-rebuild.4_ebuilds
> -rw-r--r--  1 root root      2 2007-09-26 02:10 .revdep-rebuild.5a_status
> -rw-r--r--  1 root root      2 2007-09-26 02:10 .revdep-rebuild.5b_status
> -rw-r--r--  1 root root     20 2007-09-26 02:10 .revdep-rebuild.5_order
> -rw-r--r--  1 root root      2 2007-09-26 02:10 .revdep-rebuild.6_status
> -rw-r--r--  1 root root    157 2006-12-13 18:09 .screenrc
> -rw-r--r--  1 root root      2 2006-12-13 18:09 .screenrc~
> drwxr-xr-x  3 root root   4096 2006-10-02 20:13 .scribus
> -rwxr-xr-x  1 root root  39712 2004-08-15 08:05 server.save
> drwx------  2 root root   4096 2007-06-26 00:45 .ssh
> drwx------  3 root root   4096 2007-09-29 00:53 .thumbnails
> -rwxr-xr-x  1 root root    506 2006-05-17 19:39 USE-vaild-script
> -rw-r--r--  1 root root   1329 2007-08-29 05:25 Wallpapers.kdar
> drwxr-xr-x  2 root root   4096 2006-12-22 02:53 .wireshark
> -rw-------  1 root root     51 2007-06-26 23:16 .xauthClejoT
> -rw-------  1 root root     51 2007-06-26 16:43 .xauthHe7jsL
> -rw-------  1 root root     51 2007-04-10 01:08 .xauthhYnCuf
> -rw-------  1 root root     51 2006-12-27 17:19 .xauthiFJTYh
> -rw-------  1 root root     51 2007-09-06 03:32 .xauthIQEJV1
> -rw-------  1 root root     51 2007-09-27 19:04 .xauthiXectC
> -rw-------  1 root root     51 2007-09-28 15:13 .xauthmpYx4r
> -rw-------  1 root root      0 2006-09-13 10:10 .Xauthority
> -rw-------  1 root root     51 2007-03-04 13:15 .xauthpdEPUu
> -rw-------  1 root root     51 2006-12-27 17:19 .xauthQ1QG5o
> -rw-------  1 root root     51 2007-03-18 23:21 .xauthvUHiuD
> -rw-------  1 root root     51 2007-09-27 17:47 .xauthWrAMse
> -rw-------  1 root root     51 2007-03-02 11:02 .xauthyTPJ6s
> drwxr-xr-x  2 root root   4096 2007-07-17 23:44 .xine
> root@smoker / # 
> 
> Ideas on why mine does and yours doesn't??
> 
> Dale
> 
> :-)  :-) 

Which shell do you use? Bash's default behavior (I don't know whether 
you can change that) is that it doesn't expand * to all files and 
directories but only the nonhidden.

Just try the following:
ls -l --directory --all ~/*

On my system it only shows my a long lost of all directories and files 
without a dot at the beginning although, strictly speaking, the command 
should show all files, even the hidden ones.

Is it possible that you mean regular expressions and not Bash's 
expansion feature?
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-30 12:34     ` Florian Philipp
@ 2007-09-30 13:11       ` Etaoin Shrdlu
  2007-09-30 13:33         ` Etaoin Shrdlu
  2007-09-30 16:35         ` Florian Philipp
  0 siblings, 2 replies; 11+ messages in thread
From: Etaoin Shrdlu @ 2007-09-30 13:11 UTC (permalink / raw
  To: gentoo-user

On Sunday 30 September 2007, Florian Philipp wrote:

> Which shell do you use? Bash's default behavior (I don't know whether
> you can change that) is that it doesn't expand * to all files and
> directories but only the nonhidden.
>
> Just try the following:
> ls -l --directory --all ~/*
>
> On my system it only shows my a long lost of all directories and files
> without a dot at the beginning although, strictly speaking, the
> command should show all files, even the hidden ones.

No, it should not (assuming the syntax of your example), unless 
bash "dotglob" option is on. One thing are the options to ls, another is 
how the shell expands wildcard characters.
In your example, the tilde is expanded to the user's home dir 
(eg, /home/user), the asterisk is expanded to all the file and directory 
names under /home/user not starting with ".", so what ls really sees is

ls -l --directory --all /home/user/dir1 /home/user/dir2 /home/user/file1 /home/user/file2 
etc.

Since you gave the "--directory" (aka "-d") option, and "*" expansion 
does not include names starting with ".", nothing else is printed. 
The "--all" option does not come into play at all here.

A different story would be if you did not use the -d option; then names 
at first level starting with "." still would not have been shown 
(because "*" is expanded by the shell before ls sees the names), but 
directory contents would have been listed including names starting 
with ".", due to the --all option.

Another variation would be not using -d and giving only "~" as pathname 
to ls (ie, not "~/*"). In that case, ls would see just "/home/user" and 
the --all option could do its job at the first level, listing all the 
names, even those starting with ".".

The bash option to have "*" expand to all the names, including those 
starting with ".", is "dotglob" (eg, "shopt -s dotglob). man bash 
explains it all.

> Is it possible that you mean regular expressions and not Bash's
> expansion feature?

This is possible (well, sort of) enabling the "extglob" option in bash.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-30 13:11       ` Etaoin Shrdlu
@ 2007-09-30 13:33         ` Etaoin Shrdlu
  2007-09-30 16:35         ` Florian Philipp
  1 sibling, 0 replies; 11+ messages in thread
From: Etaoin Shrdlu @ 2007-09-30 13:33 UTC (permalink / raw
  To: gentoo-user

Sorry, I hit "send" too early; my answer is missing the last part.

On Sunday 30 September 2007, Etaoin Shrdlu wrote:

> > Is it possible that you mean regular expressions and not Bash's
> > expansion feature?

This is possible (well, sort of) enabling the "extglob" option in
bash. But still, this is not directly related to whether "*" expansion 
includes names starting with "." or not.
Getting all the files, including those starting with "." (but 
excluding "." and "..") using standard bash is not really easy; an 
approximation could be taking the files matching "*", ".[^.]*", 
and "..[^$]*". These patterns still expand to their literal values if no 
files match, so at least the "nullglob" option would be useful to avoid 
error messages.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-30 13:11       ` Etaoin Shrdlu
  2007-09-30 13:33         ` Etaoin Shrdlu
@ 2007-09-30 16:35         ` Florian Philipp
  2007-09-30 23:03           ` Dale
  1 sibling, 1 reply; 11+ messages in thread
From: Florian Philipp @ 2007-09-30 16:35 UTC (permalink / raw
  To: gentoo-user

Etaoin Shrdlu schrieb:
> On Sunday 30 September 2007, Florian Philipp wrote:
> 
>> Which shell do you use? Bash's default behavior (I don't know whether
>> you can change that) is that it doesn't expand * to all files and
>> directories but only the nonhidden.
>>
>> Just try the following:
>> ls -l --directory --all ~/*
>>
>> On my system it only shows my a long lost of all directories and files
>> without a dot at the beginning although, strictly speaking, the
>> command should show all files, even the hidden ones.
> 
> No, it should not (assuming the syntax of your example), unless 
> bash "dotglob" option is on. One thing are the options to ls, another is 
> how the shell expands wildcard characters.
> In your example, the tilde is expanded to the user's home dir 
> (eg, /home/user), the asterisk is expanded to all the file and directory 
> names under /home/user not starting with ".", so what ls really sees is
> 
> ls -l --directory --all /home/user/dir1 /home/user/dir2 /home/user/file1 /home/user/file2 
> etc.
> 
> Since you gave the "--directory" (aka "-d") option, and "*" expansion 
> does not include names starting with ".", nothing else is printed. 
> The "--all" option does not come into play at all here.
> 
> A different story would be if you did not use the -d option; then names 
> at first level starting with "." still would not have been shown 
> (because "*" is expanded by the shell before ls sees the names), but 
> directory contents would have been listed including names starting 
> with ".", due to the --all option.
> 

That's exactly what I wanted to explain to Dale ;)

Sorry if I puzzled you.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-30 16:35         ` Florian Philipp
@ 2007-09-30 23:03           ` Dale
  0 siblings, 0 replies; 11+ messages in thread
From: Dale @ 2007-09-30 23:03 UTC (permalink / raw
  To: gentoo-user

Florian Philipp wrote:
>
> That's exactly what I wanted to explain to Dale ;)
>
> Sorry if I puzzled you.

I just know that -a means all files including hidden ones.  I like to
keep it simple, so I can understand it.  LOL

Dale

:-)  :-)
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] ext3 with errors
  2007-09-29 21:56 ` Neil Bothwick
@ 2007-10-01 18:52   ` Arnau Bria
  0 siblings, 0 replies; 11+ messages in thread
From: Arnau Bria @ 2007-10-01 18:52 UTC (permalink / raw
  To: gentoo-user

On Sat, 29 Sep 2007 22:56:50 +0100
Neil Bothwick wrote:

> Hello Arnau Bria,
Hi Neil,
[...]
> Create a two disk RAID1 using only your existing disk, marking the
> other disk missing. Then add your new disk and the RAID will
> automatically update it from the first disk.

I'll do so.
Thanks for your reply.
Arnau
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-10-01 19:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-29 18:32 [gentoo-user] ext3 with errors Arnau Bria
2007-09-29 21:56 ` Neil Bothwick
2007-10-01 18:52   ` Arnau Bria
2007-09-30  3:47 ` Mark Shields
2007-09-30 10:47 ` Florian Philipp
2007-09-30 11:54   ` Dale
2007-09-30 12:34     ` Florian Philipp
2007-09-30 13:11       ` Etaoin Shrdlu
2007-09-30 13:33         ` Etaoin Shrdlu
2007-09-30 16:35         ` Florian Philipp
2007-09-30 23:03           ` Dale

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox